0.0
$Id: README.txt 204 2010-11-30 02:20:04Z pwilkins $
sm-transcript reads results of SLS processing and produces transcripts for
the SpokenMedia browser. For each file in the source folder whose extension
matches the source type, a file of destination type is created in the
destination folder. All of these parameters have default values.
Note: Examples of the commands you enter in the terminal are for *nix. The
command prompt in the examples is:
felix$ <command line>
If you are a Windows user, make the usual adjustments.
Requirements:
sm-transcript is written in Ruby and packaged as a RubyGem. Since Ruby is
not a compiled language, you will need to have Ruby installed on your
machine to run sm-transcript. You can determine if Ruby is installed by
typing "ruby -v" at a terminal prompt. It should return the version of
Ruby that is installed. If Ruby is not installed on your machine, navigate
to http://www.ruby-lang.org/ and follow the installation instructions.
sm-transcript was developed using Ruby 1.8. Other Ruby versions have not
been tested as of this release.
Installation:
You can get sm-transcript as either a RubyGem or as source from svn.
The preferred way to install this package is as a Rubygem. You can
download and install the gem with this command:
felix$ sudo gem install [--verbose] sm-transcript
This command downloads the most recent version of the gem from rubygems.org
and makes it active. Previous versions of the gem remain installed, but
are deactivated.
You must use "sudo" to properly install the gem. If you execute "gem
install" (omitting the "sudo") the gem is installed in your home gem
repository and it isn't in your path without additional configuration.
Note: You need sudo privileges to run the command as written. If you
can't sudo, then you can install it locally and will need some additional
configuration. Contact me (or your local Ruby wizard) for assistance.
The executable is now in your path.
You can cleanly uninstall the gem with this command:
felix$ sudo gem uninstall sm-transcript
If you have access to our svn repository, you are welcome to check out the
code. Be warned that the trunk tip is not necessarily stable. It changes
frequently as enhancements (and bug fixes) are added. (note that the
'smb_transcript' in the command line below is not a typo.)
svn co svn+ssh://svn.mit.edu/oeit-tsa/SMB/smb_transcript/trunk sm_transcript
build the gem by running this command from the directory you installed the
source. This is what it looks like on my machine:
felix$ rake gem
The gem will be built and put in ./pkg You can now use the gem
installation instructions above.
Using the App:
Run with no command line parameters, the app reads *.wrd files out of
./results and writes *.t1.html files to ./transcripts. These directories
are relative to where sm_transcript is called.
Note: destination files are overwritten without a warning prompt. If you
want to preserve an existing output file, rename it before running the app
again.
For example, run the app by navigating to the bin folder and enter
projects/sm_transcript/bin felix$ sm_transcript
This command run from this folder will read *.wrd files from bin/results
and write *-t1.html to bin/transcripts.
Usage: sm_transcript [options]
--srcdir PATH Read files from this folder (Default: ./results)
--destdir PATH Write files to this folder (Default: ./transcripts)
--srctype wrd | seg | txt | ttml | srt Kind of file to process (Default: wrd)
--desttype html | ttml | datajs | json Kind of file to output (Default: html)
-h, --help Show this message
There is a serious gotch'a in specifying the srctype parameter: it must
match the case of the file extension that you're processing. This means
that if the srt files that you are processing have the extension .SRT, then
you must specify the srctype as "SRT". Pretty lame, I know. I will update
the gem with a fix shortly. My apologies until then.
Troubleshooting:
sm-transcript requires additional gems to operate. The RubyGem
installation should install dependencies automatically, but when it
doesn't, you get an error that includes
... no such file to load -- builder (LoadError)
in the first few lines when you run sm-transcript, the problem is a
missing dependent gem. (the error above indicates that the Builder
gem is missing.) Try installing the missing gem. For the error above,
the command looks like this on my computer:
felix$ sudo gem install builder
See "Required Gems" below for more information.
A warning message such as:
"WARNING: Nokogiri was built against LibXML version 2.7.6,
but has dynamically loaded 2.7.7""
may be safely ignored.
If you continue to have trouble, feel free to contact me.
Upgrading:
You can easily upgrade by simply executing the same command you used to
install the gem. Running install again will add the newer version and make
it active. By default the most recent version is used, but older versions
are still available, simply inactive.
If are using svn, you should already know what to do.
Required Gems:
builder - create structured data, such as XML
extensions - added for the 'require_relative' command. (To get this
command in Ruby 1.8 you need to install this gem, for Ruby 1.9
the command is already part of the core.)
htmlentities - html parsing
json - create JSON structured data
nokogiri - xml parsing library
optparse - option parsing of command line
ostruct - open data structures
ppcommand - pp is a pretty printer. It is used only for debugging
rake - make for Ruby
rubygems - support for gems (shouldn't be needed for Ruby 1.9)
shoulda - enhancement for Test::Unit
This command installs gems on OSX and Linux:
felix$ sudo gem install <gem name>
I recommend running the following command to update to latest version of
rubygems before loading new gems.
felix$ sudo gem update --system
Unit Tests:
You may run all unit tests by navigating to the test folder and running
rake with no parameters (the default rake task runs all tests). On my
computer, it looks like this:
projects/sm_transcript/test felix$ rake
Release Notes:
Initial Version - runs under Ruby 1.8.x.
version 0.0.4 - fixes bug when processing .WRD files with CRLF line
endings.
version 0.0.5 - removed due to posting error
version 0.0.6 - added srctype of ttml and desttype of json, fixed bug where
beginning time of word was actually for previous word.
version 0.0.7 - added srt as srctype
version 0.0.8 - fixed bug that dropped last phrase from transcripts
version 1.0.0 - declared this version 1.0.0 to conform more closely with
gem numbering conventions. All tests run successfully.
To Do:
- specify individual files for processing rather than folders
- fix bug in srt processing: can't read Creole srt content.
- allow user to modify the "t1" file extension for addition languages of
the same transcript.
- update code to run under Ruby 1.9
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
== PintosCheck -- Auto Pintos Checker to Save the Day ==
== Functionalities ==
The functionality of this simple script is to download pintos homework assignments from the mail inbox and then run through all the desired tests and finally generate reports in plain text or html formats, all automatically.
== Requirements For Running PintosCheck ==
Since all the scripts are written in ruby, PintosCheck require ruby installed on the system. I use ruby 1.8.7 for development, but ruby 1.9.* versions are expected to function as well. However, ruby 1.8.6 and lower versions are not supported. For information of downloading and installing ruby, see http://www.ruby-lang.org/en/downloads/.
In addition to ruby itself, RubyGems 1.3.* is also required because it hosts the installation source for this project and almost all other ruby projects as well. To download or update RubyGems, please go to http://gemcutter.org/pages/download for more information.
== Installation ==
Once you have all the requirements on your system, it's really easy to install PintosCheck. In the UNIX shell or Windows command line environment, type the following command(sudo if needed):
gem install pintoscheck --include-dependencies
Go grab a cup of coffee, and PintosCheck will automatically download and install itself onto the system.
To check the installation, type 'ptschk --version', and if something like 'PintosCheck 0.1.0' pops up then you're green to go!
== Finally, how do I check my students' pintos homework? ==
This project ships with a 'ptschk' command tool. This tool needs a task configuration file to actually do everything. The configuration file is in YAML format, which is basically a recursive key-value pair representation. If you're using PintosCheck for the first time, there's a very nice command line option to generate the skeleton for you. Just run 'ptschk init my_first_task.config' and a file named 'my_first_task.config' will be generated for you. Inside this file there is a set of the minimal options for the task to run properly, and you just have to fill in what you need. After you set up your configuration file, run 'ptschk run my_first_task.config' and the tasks will kick off immediately, and after a while the report will be generated. A detailed configuration options for advanced task setup will be available in production release of this project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Simple type-checking for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
ALPHA Alert -- just uploaded initial release.
Linux inotify is a means to receive events describing file system activity (create, modify, delete, close, etc).
Sinotify was derived from aredridel's package (http://raa.ruby-lang.org/project/ruby-inotify/), with the addition of
Paul Boon's tweak for making the event_check thread more polite (see
http://www.mindbucket.com/2009/02/24/ruby-daemons-verifying-good-behavior/)
In sinotify, the classes Sinotify::PrimNotifier and Sinotify::PrimEvent provide a low level wrapper to inotify, with
the ability to establish 'watches' and then listen for inotify events using one of inotify's synchronous event loops,
and providing access to the events' masks (see 'man inotify' for details). Sinotify::PrimEvent class adds a little semantic sugar
to the event in to the form of 'etypes', which are just ruby symbols that describe the event mask. If the event has a
raw mask of (DELETE_SELF & IS_DIR), then the etypes array would be [:delete_self, :is_dir].
In addition to the 'straight' wrapper in inotify, sinotify provides an asynchronous implementation of the 'observer
pattern' for notification. In other words, Sinotify::Notifier listens in the background for inotify events, adapting
them into instances of Sinotify::Event as they come in and immediately placing them in a concurrent queue, from which
they are 'announced' to 'subscribers' of the event. [Sinotify uses the 'cosell' implementation of the Announcements
event notification framework, hence the terminology 'subscribe' and 'announce' rather then 'listen' and 'trigger' used
in the standard event observer pattern. See the 'cosell' package on github for details.]
A variety of 'knobs' are provided for controlling the behavior of the notifier: whether a watch should apply to a
single directory or should recurse into subdirectores, how fast it should broadcast queued events, etc (see
Sinotify::Notifier, and the example in the synopsis section below). An event 'spy' can also be setup to log all
Sinotify::PrimEvents and Sinotify::Events.
Sinotify::Event simplifies inotify's muddled event model, sending events only for those files/directories that have
changed. That's not to say you can't setup a notifier that recurses into subdirectories, just that any individual
event will apply to a single file, and not to its children. Also, event types are identified using words (in the form
of ruby :symbols) instead of inotify's event masks. See Sinotify::Event for more explanation.
The README for inotify:
http://www.kernel.org/pub/linux/kernel/people/rml/inotify/README
Selected quotes from the README for inotify:
* "Rumor is that the 'd' in 'dnotify' does not stand for 'directory' but for 'suck.'"
* "The 'i' in inotify does not stand for 'suck' but for 'inode' -- the logical
choice since inotify is inode-based."
(The 's' in 'sinotify' does in fact stand for 'suck.')
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
isup is a command line utility to check if a site is up or down. Type 'isup -h' to see the help page.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
rails-tc bundles everything required to properly setup type checking with sorbet in rails projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Ame
Ame provides a simple command-line interface API for Ruby¹. It can be used
to provide both simple interfaces like that of ‹rm›² and complex ones like
that of ‹git›³. It uses Ruby’s own classes, methods, and argument lists to
provide an interface that is both simple to use from the command-line side
and from the Ruby side. The provided command-line interface is flexible and
follows commond standards for command-line processing.
¹ See http://ruby-lang.org/
² See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html
³ See http://git-scm.com/docs/
§ Usage
Let’s begin by looking at two examples, one where we mimic the POSIX¹
command-line interface to the ‹rm› command. Looking at the entry² in the
standard, ‹rm› takes the following options:
= -f. = Do not prompt for confirmation.
= -i. = Prompt for confirmation.
= -R. = Remove file hierarchies.
= -r. = Equivalent to /-r/.
It also takes the following arguments:
= FILE. = A pathname or directory entry to be removed.
And actually allows one or more of these /FILE/ arguments to be given.
We also note that the ‹rm› command is described as a command to “remove
directory entries”.
¹ See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html
² See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html
Let’s turn this specification into one using Ame’s API. We begin by adding
a flag for each of the options listed above:
class Rm < Ame::Root
flag 'f', '', false, 'Do not prompt for confirmation'
flag 'i', '', nil, 'Prompt for confirmation' do |options|
options['f'] = false
end
flag 'R', '', false, 'Remove file hierarchies'
flag 'r', '', nil, 'Equivalent to -R' do |options|
options['r'] = true
end
A flag¹ is a boolean option that doesn’t take an argument. Each flag gets
a short and long name, where an empty name means that there’s no
corresponding short or long name for the flag, a default value (true,
false, or nil), and a description of what the flag does. Each flag can
also optionally take a block that can do further processing. In this case
we use this block to modify the Hash that maps option names to their values
passed to the block to set other flags’ values than the ones that the block
is associated with. As these flags (‘i’ and ‘r’) aren’t themselves of
interest, their default values have been set to nil, which means that they
won’t be included in the Hash that maps option names to their values when
passed to the method.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#flag-class-method
There are quite a few other kinds of options besides flags that can be
defined using Ame, but flags are all that are required for this example.
We’ll get to the other kinds in later examples.
Next we add a “splus” argument.
splus 'FILE', String, 'File to remove'
A splus¹ argument is like a Ruby “splat”, that is, an Array argument at the
end of the argument list to a method preceded by a star, except that a
splus requires at least one argument. A splus argument gets a name for the
argument (‹FILE›), the type of argument it represents (String), and a
description.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#splus-class-method
Then we add a description of the command (method) itself:
description 'Remove directory entries'
Descriptions¹ will be used in help output to assist the user in using the
command.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#description-class-method
Finally, we add the Ruby method that’ll implement the command (all
preceding code included here for completeness):
class Rm < Ame::Root
version '1.0.0'
flag 'f', '', false, 'Do not prompt for confirmation'
flag 'i', '', nil, 'Prompt for confirmation' do |options|
options['f'] = false
end
flag 'R', '', false, 'Remove file hierarchies'
flag 'r', '', nil, 'Equivalent to -R' do |options|
options['r'] = true
end
splus 'FILE', String, 'File to remove'
description 'Remove directory entries'
def rm(files, options = {})
require 'fileutils'
FileUtils.send options['R'] ? :rm_r : :rm,
[first] + rest, :force => options['f']
end
end
Actually, another bit of code was also added, namely
version '1.0.0'
This sets the version¹ String of the command. This information is used
when the command is invoked with the “‹--version›” flag. This flag is
automatically added, so you don’t need to add it yourself. Another flag,
“‹--help›”, is also added automatically. When given, this flag’ll make Ame
output usage information of the command.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#version-class-method
To actually run the command, all you need to do is invoke
Rm.process
This’ll invoke the command using the command-line arguments stored in
‹ARGV›, but you can also specify other ones if you want to:
Rm.process 'rm', %w[-r /tmp/*]
The first argument to #process¹ is the name of the method to invoke, which
defaults to ‹File.basename($0)›, and the second argument is an Array of
Strings that should be processed as command-line arguments passed to the
command.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#process-class-method
If you’d store the complete ‹Rm› class defined above in a file called ‹rm›
and add ‹#! /usr/bin/ruby -w› at the beginning and ‹Rm.process› at the end,
you’d have a fully functional ‹rm› command (after making it executable).
Let’s see it in action:
% rm --help
Usage: rm [OPTIONS]... FILE...
Remove directory entries
Arguments:
FILE... File to remove
Options:
-R Remove file hierarchies
-f Do not prompt for confirmation
--help Display help for this method
-i Prompt for confirmation
-r Equivalent to -R
--version Display version information
% rm --version
rm 1.0.0
Some commands are more complex than ‹rm›. For example, ‹git›¹ has a rather
complex command-line interface. We won’t mimic it all here, but let’s
introduce the rest of the Ame API using a fake ‹git› clone as an example.
¹ See http://git-scm.com/docs/
‹Git› uses sub-commands to achieve most things. Implementing sub-commands
with Ame is done using a “dispatch”. We’ll discuss dispatches in more
detail later, but suffice it to say that a dispatch delegates processing to
a child class that’ll handle the sub-command in question. We begin by
defining our main ‹git› command using a class called ‹Git› under the
‹Git::CLI› namespace:
module Git end
class Git::CLI < Ame::Root
version '1.0.0'
class Git < Ame::Class
description 'The stupid content tracker'
def initialize; end
We’re setting things up to use the ‹Git› class as a dispatch in the
‹Git::CLI› class. The description on the ‹initialize› method will be used
as a description of the ‹git› dispatch command itself.
Next, let’s add the ‹format-patch›¹ sub-command:
description 'Prepare patches for e-mail submission'
flag ?n, 'numbered', false, 'Name output in [PATCH n/m] format'
flag ?N, 'no-numbered', nil,
'Name output in [PATCH] format' do |options|
options['numbered'] = false
end
toggle ?s, 'signoff', false,
'Add Signed-off-by: line to the commit message'
switch '', 'thread', 'STYLE', nil,
Ame::Types::Enumeration[:shallow, :deep],
'Controls addition of In-Reply-To and References headers'
flag '', 'no-thread', nil,
'Disables addition of In-Reply-To and Reference headers' do |options, _|
options.delete 'thread'
end
option '', 'start-number', 'N', 1,
'Start numbering the patches at N instead of 1'
multioption '', 'to', 'ADDRESS', String,
'Add a To: header to the email headers'
optional 'SINCE', 'N/A', 'Generate patches for commits after SINCE'
def format_patch(since = '', options = {})
p since, options
end
¹ See http://git-scm.com/docs/git-format-patch/
We’re using quite a few new Ame commands here. Let’s look at each in turn:
toggle ?s, 'signoff', false,
'Add Signed-off-by: line to the commit message'
A “toggle”¹ is a flag that also has an inverse. Beyond the flags ‘s’ and
“signoff”, the toggle also defines “no-signoff”, which will set “signoff”
to false. This is useful if you want to support configuration files that
set “signoff”’s default to true, but still allow it to be overridden on the
command line.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#toggle-class-method
When using the short form of a toggle (and flag and switch), multiple ones
may be juxtaposed after the initial one. For example, “‹-sn›” is
equivalent to “‹-s -n›” to “git format-patch›”.
switch '', 'thread', 'STYLE', nil,
Ame::Types::Enumeration[:shallow, :deep],
'Controls addition of In-Reply-To and References headers'
A “switch”¹ is an option that takes an optional argument. This allows you
to have separate defaults for when the switch isn’t present on the command
line and for when it’s given without an argument. The third argument to a
switch is the name of the argument. We’re also introducing a new concept
here in ‹Ame::Types::Enumeration›. An enumeration² allows you to limit the
allowed input to a set of Symbols. An enumeration also has a default value
in the first item to its constructor (which is aliased as ‹.[]›). In this
case, the “thread” switch defaults to nil, but, when given, will default to
‹:shallow› if no argument is given. If an argument is given it must be
either “shallow” or “deep”. A switch isn’t required to take an enumeration
as its argument default and can take any kind of default value for its
argument that Ame knows how to handle. We’ll look at this in more detail
later, but know that the type of the default value will be used to inform
Ame how to parse a command-line argument into a Ruby value.
An argument to a switch must be given, in this case, as “‹--thread=deep›”
on the command line.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#switch-class-method
² See http://disu.se/software/ame-1.0/api/user/Ame/Types/Enumeration/
option '', 'start-number', 'N', 1,
'Start numbering the patches at N instead of 1'
An “option”¹ is an option that takes an argument. The argument must always
be present and may be given, in this case, as “‹--start-number=2›” or
“‹--start-number 2›” on the command line. For a short-form option,
anything that follows the option is seen as an argument, so assuming that
“start-number” also had a short name of ‘S’, “‹-S2›” would be equivalent to
“‹-S 2›”, which would be equivalent to “‹--start-number 2›”. Note that
“‹-snS2›” would still work as expected.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#option-class-method
multioption '', 'to', 'ADDRESS', String,
'Add a To: header to the email headers'
A “multioption”¹ is an option that takes an argument and may be repeated
any number of times. Each argument will be added to an Array stored in the
Hash that maps option names to their values. Instead of taking a default
argument, it takes a type for the argument (String, in this case). Again,
types are used to inform Ame how to parse command-line arguments into Ruby
values.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#multioption-class-method
optional 'SINCE', 'N/A', 'Generate patches for commits after SINCE'
An “optional”¹ argument is an argument that isn’t required. If it’s not
present on the command line it’ll get its default value (the String
‹'N/A'›, in this case).
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#optional-class-method
We’ve now covered all kinds of options and one new kind of argument. There
are three more types of argument (one that we’ve already seen and two new)
that we’ll look into now: “argument”, “splat”, and “splus”.
description 'Annotate file lines with commit information'
argument 'FILE', String, 'File to annotate'
def annotate(file)
p file
end
An “argument”¹ is an argument that’s required. If it’s not present on the
command line, an error will be raised (and by default reported to the
terminal). As it’s required, it doesn’t take a default, but rather a type.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#argument-class-method
description 'Add file contents to the index'
splat 'PATHSPEC', String, 'Files to add content from'
def add(paths)
p paths
end
A “splat”¹ is an argument that’s not required, but may be given any number
of times. The type of a splat is the type of one argument and the type of
a splat as a whole is an Array of values of that type.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#splat-class-method
description 'Display gitattributes information'
splus 'PATHNAME', String, 'Files to list attributes of'
def check_attr(paths)
p paths
end
A “splus”¹ is an argument that’s required, but may also be given any number
of times. The type of a splus is the type of one argument and the type of
a splus as a whole is an Array of values of that type.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#splus-class-method
Now that we’ve seen all kinds of options and arguments, let’s look on an
additional tool at our disposal, the dispatch¹.
class Remote < Ame::Class
description 'Manage set of remote repositories'
def initialize; end
description 'Shows a list of existing remotes'
flag 'v', 'verbose', false, 'Show remote URL after name'
def list(options = {})
p options
end
description 'Adds a remote named NAME for the repository at URL'
argument 'name', String, 'Name of the remote to add'
argument 'url', String, 'URL to the repository of the remote to add'
def add(name, url)
p name, url
end
end
¹ See http://disu.se/software/ame-1.0/api/user/Ame/Class#dispatch-class-method
Here we’re defining a child class to Git::CLI::Git called “Remote” that
doesn’t introduce anything new. Then we set up the dispatch:
dispatch Remote, :default => 'list'
This adds a method called “remote” to Git::CLI::Git that will dispatch
processing of the command line to an instance of the Remote class when
“‹git remote›” is seen on the command line. The “remote” method expects an
argument that’ll be used to decide what sub-command to execute. Here we’ve
specified that in the absence of such an argument, the “list” method should
be invoked.
We add the same kind of dispatch to Git under Git::CLI:
dispatch Git
and then we’re done. Here’s all the previous code in its entirety:
module Git end
class Git::CLI < Ame::Root
version '1.0.0'
class Git < Ame::Class
description 'The stupid content tracker'
def initialize; end
description 'Prepare patches for e-mail submission'
flag ?n, 'numbered', false, 'Name output in [PATCH n/m] format'
flag ?N, 'no-numbered', nil,
'Name output in [PATCH] format' do |options|
options['numbered'] = false
end
toggle ?s, 'signoff', false,
'Add Signed-off-by: line to the commit message'
switch '', 'thread', 'STYLE', nil,
Ame::Types::Enumeration[:shallow, :deep],
'Controls addition of In-Reply-To and References headers'
flag '', 'no-thread', nil,
'Disables addition of In-Reply-To and Reference headers' do |options, _|
options.delete 'thread'
end
option '', 'start-number', 'N', 1,
'Start numbering the patches at N instead of 1'
multioption '', 'to', 'ADDRESS', String,
'Add a To: header to the email headers'
optional 'SINCE', 'N/A', 'Generate patches for commits after SINCE'
def format_patch(since = '', options = {})
p since, options
end
description 'Annotate file lines with commit information'
argument 'FILE', String, 'File to annotate'
def annotate(file)
p file
end
description 'Add file contents to the index'
splat 'PATHSPEC', String, 'Files to add content from'
def add(paths)
p paths
end
description 'Display gitattributes information'
splus 'PATHNAME', String, 'Files to list attributes of'
def check_attr(paths)
p paths
end
class Remote < Ame::Class
description 'Manage set of remote repositories'
def initialize; end
description 'Shows a list of existing remotes'
flag 'v', 'verbose', false, 'Show remote URL after name'
def list(options = {})
p options
end
description 'Adds a remote named NAME for the repository at URL'
argument 'name', String, 'Name of the remote to add'
argument 'url', String, 'URL to the repository of the remote to add'
def add(name, url)
p name, url
end
end
dispatch Remote, :default => 'list'
end
dispatch Git
end
If we put this code in a file called “git” and add ‹#! /usr/bin/ruby -w› at
the beginning and ‹Git::CLI.process› at the end, you’ll have a very
incomplete git command-line interface on your hands. Let’s look at what
some of its ‹--help› output looks like:
% git --help
Usage: git [OPTIONS]... METHOD [ARGUMENTS]...
The stupid content tracker
Arguments:
METHOD Method to run
[ARGUMENTS]... Arguments to pass to METHOD
Options:
--help Display help for this method
--version Display version information
Methods:
add Add file contents to the index
annotate Annotate file lines with commit information
check-attr Display gitattributes information
format-patch Prepare patches for e-mail submission
remote Manage set of remote repositories
% git format-patch --help
Usage: git format-patch [OPTIONS]... [SINCE]
Prepare patches for e-mail submission
Arguments:
[SINCE=N/A] Generate patches for commits after SINCE
Options:
-N, --no-numbered Name output in [PATCH] format
--help Display help for this method
-n, --numbered Name output in [PATCH n/m] format
--no-thread Disables addition of In-Reply-To and Reference headers
-s, --signoff Add Signed-off-by: line to the commit message
--start-number=N Start numbering the patches at N instead of 1
--thread[=STYLE] Controls addition of In-Reply-To and References headers
--to=ADDRESS* Add a To: header to the email headers
% git remote --help
Usage: git remote [OPTIONS]... [METHOD] [ARGUMENTS]...
Manage set of remote repositories
Arguments:
[METHOD=list] Method to run
[ARGUMENTS]... Arguments to pass to METHOD
Options:
--help Display help for this method
Methods:
add Adds a remote named NAME for the repository at URL
list Shows a list of existing remotes
§ API
The previous section gave an introduction to the whole user API in an
informal and introductory way. For an indepth reference to the user API,
see the {user API documentation}¹.
¹ See http://disu.se/software/ame-1.0/api/user/Ame/
If you want to extend the API or use it in some way other than as a
command-line-interface writer, see the {developer API documentation}¹.
¹ See http://disu.se/software/ame-1.0/api/developer/Ame/
§ Financing
Currently, most of my time is spent at my day job and in my rather busy
private life. Please motivate me to spend time on this piece of software
by donating some of your money to this project. Yeah, I realize that
requesting money to develop software is a bit, well, capitalistic of me.
But please realize that I live in a capitalistic society and I need money
to have other people give me the things that I need to continue living
under the rules of said society. So, if you feel that this piece of
software has helped you out enough to warrant a reward, please PayPal a
donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
¹ Send a donation:
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now@disu.se&item_name=Ame
§ Reporting Bugs
Please report any bugs that you encounter to the {issue tracker}¹.
¹ See https://github.com/now/ame/issues
§ Authors
Nikolai Weibull wrote the code, the tests, the documentation, and this
README.
§ Licensing
Ame is free software: you may redistribute it and/or modify it under the
terms of the {GNU Lesser General Public License, version 3}¹ or later², as
published by the {Free Software Foundation}³.
¹ See http://disu.se/licenses/lgpl-3.0/
² See http://gnu.org/licenses/
³ See http://fsf.org/
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
When making an api that uses objects that belong to another object, it is possible to create objects that don't belong to any object. What this gem does is it checks to make sure the id and type map to an object before creation and if it does not it will create an error on the record. If an object is imageable, no worries it still works!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Gem helps to do next things with your objects - check the type, make a conversions and work with hashes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Contains validators for date and time values, type checking.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
U
U extends Ruby’s Unicode support. It provides a string class called
U::String with an interface that mimics that of the String class in Ruby 2.0,
but that can also be used from both Ruby 1.8. This interface also has more
complete Unicode support and never modifies the receiver. Thus, a U::String
is an immutable value object.
U comes with complete and very accurate documentation¹. The documentation can
realistically also be used as a reference to the Ruby String API and may
actually be preferable, as it’s a lot more explicit and complete than the
documentation that comes with Ruby.
¹ See http://disu.se/software/u-1.0/api/
§ Installation
Install u with
% gem install u
§ Usage
Usage is basically the following:
require 'u-1.0'
a = 'äbc'
a.upcase # ⇒ 'äBC'
a.u.upcase # ⇒ 'ÄBC'
That is, you require the library, then you invoke #u on a String. This’ll
give you a U::String that has much better Unicode support than a normal
String. It’s important to note that U only uses UTF-8, which means that #u
will try to #encode the String as such. This shouldn’t be an issue in most
cases, as UTF-8 is now more or less the universal encoding – and rightfully
so.
As U::Strings¹ are immutable value objects, there’s also a U::Buffer²
available for building U::Strings efficiently.
See the API³ for more complete usage information. The following sections
will only cover the extensions and differences that U::String exhibit from
Ruby’s built-in String class.
¹ See http://disu.se/software/u-1.0/api/U/String/
² See http://disu.se/software/u-1.0/api/U/Buffer/
³ See http://disu.se/software/u-1.0/api/
§ Unicode Properties
There are quite a few property-checking interrogators that let you check
if all characters in a U::String have the given Unicode property:
• #alnum?¹
• #alpha?²
• #assigned?³
• #case_ignorable?⁴
• #cased?⁵
• #cntrl?⁶
• #defined?⁷
• #digit?⁸
• #graph?⁹
• #newline?¹⁰
• #print?¹¹
• #punct?¹²
• #soft_dotted?¹³
• #space?¹⁴
• #title?¹⁵
• #valid?¹⁶
• #wide?¹⁷
• #wide_cjk?¹⁸
• #xdigit?¹⁹
• #zero_width?²⁰
¹ See http://disu.se/software/u-1.0/api/U/String/#alnum-p-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#alpha-p-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#assigned-p-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#case_ignorable-p-instance-method
⁵ See http://disu.se/software/u-1.0/api/U/String/#cased-p-instance-method
⁶ See http://disu.se/software/u-1.0/api/U/String/#cntrl-p-instance-method
⁷ See http://disu.se/software/u-1.0/api/U/String/#defined-p-instance-method
⁸ See http://disu.se/software/u-1.0/api/U/String/#digit-p-instance-method
⁹ See http://disu.se/software/u-1.0/api/U/String/#graph-p-instance-method
¹⁰ See http://disu.se/software/u-1.0/api/U/String/#newline-p-instance-method
¹¹ See http://disu.se/software/u-1.0/api/U/String/#print-p-instance-method
¹² See http://disu.se/software/u-1.0/api/U/String/#punct-p-instance-method
¹³ See http://disu.se/software/u-1.0/api/U/String/#soft_dotted-p-instance-method
¹⁴ See http://disu.se/software/u-1.0/api/U/String/#space-p-instance-method
¹⁵ See http://disu.se/software/u-1.0/api/U/String/#title-p-instance-method
¹⁶ See http://disu.se/software/u-1.0/api/U/String/#valid-p-instance-method
¹⁷ See http://disu.se/software/u-1.0/api/U/String/#wide-p-instance-method
¹⁸ See http://disu.se/software/u-1.0/api/U/String/#wide_cjk-p-instance-method
¹⁹ See http://disu.se/software/u-1.0/api/U/String/#xdigit-p-instance-method
²⁰ See http://disu.se/software/u-1.0/api/U/String/#zero_width-p-instance-method
Similar to these methods are
• #folded?¹
• #lower?²
• #upper?³
which check whether a ‹U::String› has been cased in a given manner.
¹ See http://disu.se/software/u-1.0/api/U/String/#folded-p-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#lower-p-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#upper-p-instance-method
There’s also a #normalized?¹ method that checks whether a ‹U::String› has
been normalized on a given form.
¹ See http://disu.se/software/u-1.0/api/U/String/#normalized-p-instance-method
You can also access certain Unicode properties of the characters of a
U::String:
• #canonical_combining_class¹
• #general_category²
• #grapheme_break³
• #line_break⁴
• #script⁵
• #word_break⁶
¹ See http://disu.se/software/u-1.0/api/U/String/#canonical_combining_class-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#general_category-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#grapheme_break-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#line_break-instance-method
⁵ See http://disu.se/software/u-1.0/api/U/String/#script-instance-method
⁶ See http://disu.se/software/u-1.0/api/U/String/#word_break-instance-method
§ Locale-specific Comparisons
Comparisons of U::Strings respect the current locale (and also allow you
to specify a locale to use): ‹#<=>›¹, #casecmp², and #collation_key³.
¹ See http://disu.se/software/u-1.0/api/U/String/#comparison-operator
² See http://disu.se/software/u-1.0/api/U/String/#casecmp-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#collation_key-instance-method
§ Additional Enumerators
There are a couple of additional enumerators in #each_grapheme_cluster¹
and #each_word² (along with aliases #grapheme_clusters³ and #words⁴).
¹ See http://disu.se/software/u-1.0/api/U/String/#each_grapheme_cluster-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#each_word-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#grapheme_clusters-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#words-instance-method
§ Unicode-aware Sub-sequence Removal
#Chomp¹, #chop², #lstrip³, #rstrip⁴, and #strip⁵ all look for Unicode
newline and space characters, rather than only ASCII ones.
¹ See http://disu.se/software/u-1.0/api/U/String/#chomp-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#chop-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#lstrip-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#rstrip-instance-method
⁵ See http://disu.se/software/u-1.0/api/U/String/#strip-instance-method
§ Unicode-aware Conversions
Case-shifting methods #downcase¹ and #upcase² do proper Unicode casing
and the interface is further augmented by #foldcase³ and #titlecase⁴.
#Mirror⁵ and #normalize⁶ do conversions similar in nature to the
case-shifting methods.
¹ See http://disu.se/software/u-1.0/api/U/String/#downcase-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#upcase-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#foldcase-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#titlecase-instance-method
⁵ See http://disu.se/software/u-1.0/api/U/String/#mirror-instance-method
⁶ See http://disu.se/software/u-1.0/api/U/String/#normalize-instance-method
§ Width Calculations
#Width¹ will return the number of cells on a terminal that a U::String
will occupy.
#Center², #ljust³, and #rjust⁴ deal in width rather than length, making
them much more useful for generating terminal output. #%⁵ (and its alias
#format⁶) similarly deal in width.
¹ See http://disu.se/software/u-1.0/api/U/String/#width-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#center-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#ljust-instance-method
⁴ See http://disu.se/software/u-1.0/api/U/String/#rjust-instance-method
⁵ See http://disu.se/software/u-1.0/api/U/String/#modulo-operator
⁶ See http://disu.se/software/u-1.0/api/U/String/#format-instance-method
§ Extended Type Conversions
Finally, #hex¹, #oct², and #to_i³ use Unicode alpha-numerics for their
respective conversions.
¹ See http://disu.se/software/u-1.0/api/U/String/#hex-instance-method
² See http://disu.se/software/u-1.0/api/U/String/#oct-instance-method
³ See http://disu.se/software/u-1.0/api/U/String/#to_i-instance-method
§ News
§ 1.0.0
Initial public release!
§ Financing
Currently, most of my time is spent at my day job and in my rather busy
private life. Please motivate me to spend time on this piece of software
by donating some of your money to this project. Yeah, I realize that
requesting money to develop software is a bit, well, capitalistic of me.
But please realize that I live in a capitalistic society and I need money
to have other people give me the things that I need to continue living
under the rules of said society. So, if you feel that this piece of
software has helped you out enough to warrant a reward, please PayPal a
donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
¹ Send a donation:
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now@disu.se&item_name=U
§ Reporting Bugs
Please report any bugs that you encounter to the {issue tracker}¹.
¹ See https://github.com/now/u/issues
§ Authors
Nikolai Weibull wrote the code, the tests, the documentation, and this
README.
§ Licensing
U is free software: you may redistribute it and/or modify it under the
terms of the {GNU Lesser General Public License, version 3}¹ or later², as
published by the {Free Software Foundation}³.
¹ See http://disu.se/licenses/lgpl-3.0/
² See http://gnu.org/licenses/
³ See http://fsf.org/
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
check flirt by blood type
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
A Gem to get files Header, Footer, Type(via headers), create file checksum, check file checksum, Carving and ... .
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Gem to parse Facebook ID's from various Facebook URL types. The five link types are: Status, Photo, Video, Link, Checkin.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Checks for valid content type of excel files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
Reliable contract definition, data validation, and type checking for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
# Gadget
Some methods for getting metadata and other deep details from a PostgreSQL database.
## Installation
Add this line to your application's Gemfile:
gem 'gadget'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gadget
## Usage
`#tables(conn)`
Returns a list of all tables in the schema reachable through `conn`.
`#columns(conn, tablename=nil)`
Returns a list of all columns in the schema reachable through `conn`.
If `tablename` is given, returns the columns in only that table.
`#foreign_keys(conn, tablename=nil)`
Returns a list of all foreign keys in the schema reachable through `conn`.
If `tablename` is given, returns the foreign keys in only that table.
`#constraints(conn, tablename=nil)`
Returns a list of all constraints in the schema reachable through `conn`.
If `tablename` is given, returns the constraints in only that table.
`#dependencies(conn)`
Returns a structure representing the dependencies between tables in the schema reachable through `conn`.
Table A is defined as dependent on table B if A contains a foreign key reference to B.
`#tables_in_dependency_order(conn)`
Returns a list of all tables in the schema reachable through `conn`, ordered such that any given table
appears later in the list than all of its dependencies.
`#dependency_graph(conn)`
Returns `.dot` script (suitable for feeding into Graphviz) describing the table dependency graph.
`#functions(conn)`
Returns a list of all functions in the schema reachable through `conn`.
`#sequences(conn)`
Returns a list of all sequences in the schema reachable through `conn`.
`#triggers(conn)`
Returns a list of all triggers in the schema reachable through `conn`.
`#types(conn)`
Returns a list of all types in the schema reachable through `conn`.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
This gem with asks user input for there state name, then will prompt the use to type there city they would like to check the daily weather of."
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
A rich language which compiles to ruby. Including type annotations, type checking, macros, annotations, enums and more
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity
0.0
QuacksLike is a module for RSpec to add matchers that test if an object is fully duck-typed to pretend to be another class. This kind of thing is really only necessary when passing such an object as the return value in an API where you don't know exactly how it will be consumed, but it needs to "quack like an Array" or something. It does its job by checking every instance method in the class that the target object needs to "quack like" and makes sure the target both responds to that method name and that the arity of the method is appropriate.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Activity