indentation-0.1.1/0000755000004100000410000000000012256156015014060 5ustar www-datawww-dataindentation-0.1.1/spec/0000755000004100000410000000000012256156015015012 5ustar www-datawww-dataindentation-0.1.1/spec/rdoc_examples_spec.rb0000644000004100000410000000033512256156015021177 0ustar www-datawww-datarequire 'spec_helper' describe "Readme Rdoc examples" do rdoc_examples.each do |example_name, example_code| it "should pass the #{example_name} example from the README" do eval(example_code) end end endindentation-0.1.1/spec/.rspec0000644000004100000410000000000712256156015016124 0ustar www-datawww-data-c -fd indentation-0.1.1/spec/spec_helper.rb0000644000004100000410000000326612256156015017637 0ustar www-datawww-databegin require 'rspec' rescue LoadError require 'rubygems' unless ENV['NO_RUBYGEMS'] gem 'rspec' require 'rspec' end $:.unshift(File.dirname(__FILE__) + '/../lib') require 'indentation' def rdoc_examples(examples_header = /^Examples:/i) readme_rdoc = File.join(File.dirname(__FILE__), '../README.rdoc') rdoc_content = File.read(readme_rdoc) example_content = rdoc_content.split(/^== /).select{|p| p =~ examples_header}.first raise "Couldn't find Examples header matching: #{examples_header}" unless example_content examples_content = example_content.split('=== ') examples = {} # Skipping first 'example' since it is "Examples:\n" examples_content[1..-1].each do |excon| lines = excon.split("\n") example_name = lines.shift.delete(':') example_code = [] example_code << "$stdout = StringIO.new" lines.each do |line| l = line if l =~ / # => / code, check = line.split(/ # => /) # Could make this more sophisticated, but just going with == l = code + ".should == " + check elsif l =~ /(.*) ?# :([^ ]*) => (.*)$/ code = $~[1] var = $~[2].to_sym value = $~[3] case var when :stdout l = "#{code}\n $stdout.string.chomp.split(%!\n!).last.should == %!#{value}!" else raise "Unkown variable type: #{var}" end end example_code << l end # Debugging to show all of stdout during example #example_code << "stdoutput = $stdout.string" example_code << "$stdout = STDOUT" #example_code << "puts stdoutput" examples[example_name.to_sym] = example_code.join("\n") end examples end def time t = Time.now yield Time.now - t endindentation-0.1.1/spec/indentation_spec.rb0000644000004100000410000002675512256156015020704 0ustar www-datawww-datarequire File.dirname(__FILE__) + '/spec_helper.rb' # Time to add your specs! # http://rspec.info/ describe "Single-line String indentation" do it "should indent a string using 2 spaces as the default" do "test string".indent.should == " test string" end it "should indent a given string the passed amount of indentation" do "test string".indent(3).should == " test string" "test string".indent(0).should == "test string" end it "should indent a string using 1 tab as default, if tabs were specified but an amount was not" do "test string".indent(nil, "\t").should == "\ttest string" end it "should indent a string the passed amount of tabbed indentation" do "test string ".indent(3, "\t").should == "\t\t\ttest string " "test string ".indent(0, "\t").should == "test string " end it "should indent a string using the passed indentation character" do "test string".indent(1, "!").should == "!test string" "test string".indent(2, "--").should == "----test string" end it "should remove tab and space indentation if a negative amount is specified" do " test string ".indent(-2).should == " test string " " test string ".indent(-3).should == "test string " " test string ".indent(-4).should == "test string " "\t test string ".indent(-2).should == " test string " "\t test string ".indent(-3).should == "test string " "\t test string ".indent(-4).should == "test string " " \t test string ".indent(-2).should == " test string " " \t test string ".indent(-3).should == "test string " " \t test string ".indent(-4).should == "test string " " \ttest string ".indent(-2).should == "\ttest string " " \ttest string ".indent(-3).should == "test string " " \ttest string ".indent(-4).should == "test string " "\t\t\ttest string ".indent(-2).should == "\ttest string " "\t\t\ttest string ".indent(-3).should == "test string " "\t\t\ttest string ".indent(-4).should == "test string " end it "should remove tab, space, and the specified indentation type if a negative amount and indentation character is specified" do " \t\t\t---my string".indent(-8, '-').should == "-my string" " \t\t\t---my string".indent(-8).should == "---my string" " --- my string".indent(-4, "---").should == " my string" end end describe "Multi-line String indentation" do it "should indent each line within the given string" do " this\nis\na\n test\n".indent.should == " this\n is\n a\n test\n " " this\nis\na\n test\n".indent(3).should == " this\n is\n a\n test\n " " this\nis\na\n test\n".indent(3, "\t").should == "\t\t\t this\n\t\t\tis\n\t\t\ta\n\t\t\t test\n\t\t\t" end it "should de-indent each line within the given string" do " \t\t\t This\n is \n a\ntest\n ".indent(-1).should == " \t\t\t This\n is \na\ntest\n" " \t\t\t This\n is \n a\ntest\n ".indent(-2).should == " \t\t\t This\n is \na\ntest\n" " \t\t\t This\n is \n a\ntest\n ".indent(-3).should == "\t\t\t This\nis \na\ntest\n" " \t\t\t This\n is \n a\ntest\n ".indent(-6).should == " This\nis \na\ntest\n" " \t\t\t This\n is \n a\ntest\n ".indent(-7).should == "This\nis \na\ntest\n" " \t\t\t This\n is \n a\ntest\n ".indent(-8).should == "This\nis \na\ntest\n" end end describe "Single-line Array indentation" do before :all do @test_array = ['ali', ' bob', 'charlie'] end it "should indent each element 2 spaces by default" do indented_array = @test_array.indent indented_array[0].should == ' ali' indented_array[1].should == ' bob' indented_array[2].should == ' charlie' end it "should indent each element using 1 tab as default, if tabs were specified but an amount was not" do indented_array = @test_array.indent(nil, "\t") indented_array[0].should == "\tali" indented_array[1].should == "\t bob" indented_array[2].should == "\tcharlie" end it "should remove indentation if a negative amount was specified" do indented_array = @test_array.indent.indent(1, "\t").indent(3) # => [" \t ali", " \t bob", " \t charlie"] # Check that the array was correctly created indented_array[0].should == " \t ali" indented_array[1].should == " \t bob" indented_array[2].should == " \t charlie" # De-indent the array deindented_array = indented_array.indent(-7) deindented_array[0].should == "ali" deindented_array[1].should == " bob" deindented_array[2].should == "charlie" end end describe "Multi-line Array indentation" do before :all do @test_array = ["\n \t\n test\n", " One\n Two\n Three", "This\nis\na\ntest"] end it "should indent each line of each element 2 spaces by default" do indented_array = @test_array.indent indented_array[0].should == " \n \t\n test\n " indented_array[1].should == " One\n Two\n Three" indented_array[2].should == " This\n is\n a\n test" end it "should indent each line of each element using 1 tab as default, if tabs were specified but an amount was not" do indented_array = @test_array.indent(nil, "\t") indented_array[0].should == "\t\n\t \t\n\t test\n\t" indented_array[1].should == "\t One\n\t Two\n\t Three" indented_array[2].should == "\tThis\n\tis\n\ta\n\ttest" end it "should remove indentation if a negative amount was specified" do deindented_array = @test_array.indent(-1) deindented_array[0].should == "\n\t\ntest\n" deindented_array[1].should == "One\n Two\n Three" deindented_array[2].should == "This\nis\na\ntest" end it "should indent any contained arrays if they exist" do array = @test_array array << ["This", 'is', "a", "test"] indented_array = array.indent indented_array[3][0].should == " This" indented_array[3][1].should == " is" indented_array[3][2].should == " a" indented_array[3][3].should == " test" end end describe "Append Separator function" do before :each do @strings = ['bob', 'sue', 'joe'] @arrays = [['one', 'two', 'three'], ['1', '2', '3'], ['uno', 'dos', 'tres']] end it "should append the given separator to the end of each string except the last if called on an array of strings" do separated_array = @strings.append_separator("!") separated_array[0].should == "bob!" separated_array[1].should == "sue!" separated_array[2].should == "joe" end it "should append the given separator to the end of each array except the last if called on an array of arrays" do separated_array = @arrays.append_separator("!") separated_array[0].last.should == "!" separated_array[1].last.should == "!" separated_array[2].last.should == "tres" end it "should not modify the current array unless the '!' version of the function is used - Strings" do @strings.append_separator("!") @strings[0].should == 'bob' @strings[1].should == 'sue' @strings[2].should == 'joe' end it "should not modify the current array unless the '!' version of the function is used - Arrays" do @arrays.append_separator("!") @arrays[0].last.should == "three" @arrays[1].last.should == "3" @arrays[2].last.should == "tres" end it "should apply changes to the current array if the '!' version of the function is used - Strings" do @strings.append_separator!("!") @strings[0].should == 'bob!' @strings[1].should == 'sue!' @strings[2].should == 'joe' end it "should apply changes to the current array if the '!' version of the function is used - Arrays" do @arrays.append_separator!("!") @arrays[0].last.should == "!" @arrays[1].last.should == "!" @arrays[2].last.should == "tres" end end describe "Find Least Indentation function" do it "should return the least amount of indentation on any line within an Array or String" do test_string_one = " \tThis\n is a\n \ttest" test_string_two = " \t Test\n Number\n Two" test_string_one.find_least_indentation.should == 2 test_string_two.find_least_indentation.should == 7 test_array = [test_string_one, test_string_two] test_array.find_least_indentation.should == 2 test_array << " Test\n again!" test_array.find_least_indentation.should == 1 test_array << "No Indentation!" test_array.find_least_indentation.should == 0 test_array << "" test_array.find_least_indentation.should == 0 end end describe "Reset Indentation function" do it "should remove the least amount of indentation found in a String or Array" do test_string = <<-EOS.chomp.reset_indentation def method_name(arg) # Do stuff here end EOS test_string.should == "def method_name(arg)\n # Do stuff here\nend" test_array = [" def method_name(arg)", " # Do stuff here", " end"] test_array.reset_indentation.join("\n").should == test_string end it "should allow a modifier to be passed that changes how much indentation is added/removed" do string = <<-EOS def method_name(arg) # Do stuff here end EOS test_string = string.chomp.reset_indentation(2) test_string.should == " def method_name(arg)\n # Do stuff here\n end" test_array = [" def method_name(arg)", " # Do stuff here", " end"] test_array.reset_indentation(2).join("\n").should == test_string # Use of negative indentation works here too string.chomp.reset_indentation(-1).should == "def method_name(arg)\n # Do stuff here\nend" test_array.reset_indentation(-1).join("\n").should == string.chomp.reset_indentation(-1) end it "should not modify the current object unless the '!' version of the function is used - String" do string = " This\n is\n a test" string.reset_indentation.should == "This\n is\na test" string.should == " This\n is\n a test" end it "should not modify the current object unless the '!' version of the function is used - Array" do array = [" This", " is", " a test"] array.reset_indentation.should == ["This", " is", "a test"] array.should == [" This", " is", " a test"] end it "should apply changes to the current object if the '!' version of the function is used - String" do string = " This\n is\n a test" string.reset_indentation!.should == "This\n is\na test" string.should == "This\n is\na test" end it "should apply changes to the current object if the '!' version of the function is used - Array" do array = [" This", " is", " a test"] array.reset_indentation!.should == ["This", " is", "a test"] array.should == ["This", " is", "a test"] end end describe "English Join function" do it "should use the given conjunction to join the words with comma separation" do [].english_join.should == '' ['one'].english_join.should == 'one' ['one', 'two'].english_join.should == 'one and two' ['one', 'two', 'three'].english_join.should == 'one, two, and three' end it "should override the default conjunction with the passed conjunction" do ['one', 'two', 'three'].english_join('or').should == 'one, two, or three' end it "should override the default separator with the passed separator" do ['one', 'two', 'three'].english_join('or', ' ').should == 'one two or three' end it "should allow turning off the oxford comma" do ['one', 'two', 'three'].english_join('and', ', ', false).should == 'one, two and three' end endindentation-0.1.1/README.rdoc0000644000004100000410000001475712256156015015704 0ustar www-datawww-data= Indentation * http://github.com/samueldana/indentation == DESCRIPTION: A small library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings. Has the capability of working with multi-line strings. If you frequently use String arrays to manipulate text, see synopsis (In README.rdoc) for examples of how indentation can make your life easier. == EXAMPLES: === Indent # Default indentation is 2 spaces "test".indent # => " test" # Amount of indentation can be changed "test".indent(3) # => " test" # Indentation character (or string) is set as the second parameter of indent. "test".indent(2, "\t") # => "\t\ttest" # Operates on multi-line strings "this\nis\na\ntest".indent # => " this\n is\n a\n test" # Indent method accepts negative values (Removes tabs, spaces, and supplied indentation string) " test".indent(-1) # => " test" "\t test".indent(-5) # => "test" "\t-- Test".indent(-10) # => "-- Test" "\t-- Test".indent(-10, '-') # => "Test" "--- Test".indent(-2, '--') # => "- Test" # Operates on arrays ["one", "two"].indent # => [" one", " two"] [["one", " two"], ["uno", "\t\tdos"]].indent # => [[" one", " two"], [" uno", " \t\tdos"]] === Reset Indentation # 'resets' the indentation of a string by finding the least amount of indentation in the String/Array, and # removing that amount from every line. " def method_name\n # Do stuff\n end".reset_indentation # => "def method_name\n # Do stuff\nend" # Operates on arrays [" def method_name", " # Do stuff", " end"].reset_indentation # => ["def method_name", " # Do stuff", "end"] # Useful for heredocs - must chomp to remove trailing newline my_string = <<-EOS.chomp.reset_indentation def method_name # Do stuff end EOS my_string # => "def method_name\n # Do stuff\nend" # Accepts an indentation modifier " one\n two".reset_indentation(1) # => " one\n two" " one\n two".reset_indentation(0) # => " one\ntwo" # Default behavior " one\n two".reset_indentation(-1) # => "one\ntwo" === Append Separator # Given an Array of Arrays or an Array of Strings, appends a separator object to all but the last element in the Array. # NOTE: For an Array of Strings the separator object must be a String, since it is appended to other Strings ["arg1", "arg2", "arg3"].append_separator("!") # => ["arg1!", "arg2!", "arg3"] [["line1"], ["line2"], ["line3"]].append_separator("") # => [["line1", ""], ["line2", ""], ["line3"]] [["line1", "line2"], ["line3", "line4"]].append_separator("") # => [["line1", "line2", ""], ["line3", "line4"]] # Useful combined with indent and join vars = ["var1", "var2", "var3", "var4"] method_def = ["def add_up(#{vars.join(', ')})"] method_body = vars.append_separator(" + ") method_def += method_body.indent method_def << "end" method_def.join("\n") # => # def add_up(var1, var2, var3, var4) # var1 + # var2 + # var3 + # var4 # end # Handy for separating arrays of string arrays test_array = [["this", "is", "a", "test"], ["quick", "brown", "fox"], ["lazy", "typist"]] test_array.append_separator("").join("\n") # => # this # is # a # test # # quick # brown # fox # # lazy # typist === Find Least Indentation # Given a String or Array of Strings, finds the least indentation on any line. Splits on newlines found within strings # to find the least indentation within a multi-line String " test".find_least_indentation # => 2 " three\n two \n one".find_least_indentation # => 1 [" two", " three", " four"].find_least_indentation # => 2 [" two", " three", [" four", " five\n one"]].find_least_indentation # => 1 # Option to ignore blank (no characters whatsoever) lines. # Note, disabling this option will automatically disable :ignore_empty_lines # Default => true " three\n".find_least_indentation # => 3 " three\n".find_least_indentation(:ignore_blank_lines => false) # => 0 # Option to ignore both blank lines (no characters whatsoever) and empty lines (whitespace-only) # Implies :ignore_blank_lines => true when enabled # Default => true " three\n ".find_least_indentation # => 3 " three\n ".find_least_indentation(:ignore_empty_lines => false) # => 1 " three\n".find_least_indentation # => 3 " three\n".find_least_indentation(:ignore_empty_lines => false) # => 0 # To ignore blank, but not empty, lines: " three\n ".find_least_indentation(:ignore_blank_lines => true, :ignore_empty_lines => false) # => 1 " three\n".find_least_indentation(:ignore_blank_lines => true, :ignore_empty_lines => false) # => 3 === English Array Join # Given an Array of Strings and an optional conjunction, joins them using English list punctuation # to find the least indentation within a multi-line String ['one', 'two'].english_join # => "one and two" ['one', 'two', 'three'].english_join # => "one, two, and three" # Different conjunction ['one', 'two', 'three'].english_join('or') # => "one, two, or three" # Different separator ['one', 'two', 'three'].english_join('or', ' ') # => "one two or three" == REQUIREMENTS: * none == INSTALL: * [sudo] gem install indentation * (Use sudo unless using rvm) == LICENSE: (The MIT License) Copyright (c) 2010 Prometheus Computing Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.indentation-0.1.1/lib/0000755000004100000410000000000012256156015014626 5ustar www-datawww-dataindentation-0.1.1/lib/indentation/0000755000004100000410000000000012256156015017142 5ustar www-datawww-dataindentation-0.1.1/lib/indentation/array_mod.rb0000644000004100000410000000636412256156015021455 0ustar www-datawww-dataclass Array # Appends a given separator(s) to all but the last element in an array of Strings # or if performed on an array of arrays, appends the separator element to the end of each array except the last def append_separator(*separators) len = self.length ret_array = Array.new self.each_with_index do |element, i| new_element = element.dup unless i == len - 1 separators.each do |separator| new_element << separator end end ret_array << new_element end ret_array end # Append the given separator(s) to the current array def append_separator!(*separators) len = self.length self.each_with_index do |element, i| unless i == len - 1 separators.each do |separator| element << separator end end end end # Return an indented array of strings (or an array of other arrays containing strings) # Arguments: # * num - How many of the specified indentation to use. # Default for spaces is 2. Default for other is 1. # If set to a negative value, removes that many of the specified indentation character, # tabs, or spaces from the beginning of the string # * i_char - Character (or string) to use for indentation def indent(num = nil, i_char = ' ') self.collect do |array_element| array_element.indent(num, i_char) end end # Apply indentation to this array # Arguments: # * num - How many of the specified indentation to use. # Default for spaces is 2. Default for other is 1. # If set to a negative value, removes that many of the specified indentation character, # tabs, or spaces from the beginning of the string # * i_char - Character (or string) to use for indentation def indent!(num = nil, i_char = ' ') self.collect! do |array_element| array_element.indent!(num, i_char) end end # Get the least indentation of all elements def find_least_indentation(options = {:ignore_blank_lines => true, :ignore_empty_lines => true}) self.collect{|array_element| array_element.find_least_indentation }.min end # Find the least indentation of all elements and remove that amount (if any) # Can pass an optional modifier that changes the indentation amount removed def reset_indentation(modifier = 0) indent(-find_least_indentation + modifier) end # Replaces the current array with one that has its indentation reset # Can pass an optional modifier that changes the indentation amount removed def reset_indentation!(modifier = 0) indent!(-find_least_indentation + modifier) end # Join an array of strings using English list punctuation. def english_join(conjunction = 'and', separator = ', ', oxford_comma = true) len = self.length return '' if len == 0 return self[0].to_s if len == 1 return "#{self[0].to_s} #{conjunction} #{self[1].to_s}" if len == 2 join_str = '' self.each_with_index{|ele, i| str = if !oxford_comma && i == len - 2 "#{ele} #{conjunction} " elsif i == len - 2 "#{ele}#{separator}#{conjunction} " elsif i == len - 1 "#{ele}" else "#{ele}#{separator}" end join_str << str } join_str end endindentation-0.1.1/lib/indentation/string_mod.rb0000644000004100000410000000565712256156015021651 0ustar www-datawww-dataclass String # Return an indented copy of this string # Arguments: # * num - How many of the specified indentation to use. # Default for spaces is 2. Default for other is 1. # If set to a negative value, removes that many of the specified indentation character, # tabs, or spaces from the beginning of the string # * i_char - Character (or string) to use for indentation def indent(num = nil, i_char = ' ') _indent(num, i_char) end # Indents this string # Arguments: # * num - How many of the specified indentation to use. # Default for spaces is 2. Default for other is 1. # If set to a negative value, removes that many of the specified indentation character, # tabs, or spaces from the beginning of the string # * i_char - Character (or string) to use for indentation def indent!(num = nil, i_char = ' ') replace(_indent(num, i_char)) end # Split across newlines and return the fewest number of indentation characters found on each line def find_least_indentation(options = {:ignore_blank_lines => true, :ignore_empty_lines => true}) # Cannot ignore empty lines unless we're also ignoring blank lines options[:ignore_blank_lines] = options[:ignore_empty_lines] ? true : options[:ignore_blank_lines] empty? ? 0 : split("\n", -1).reject{|line| if options[:ignore_empty_lines] line.strip.empty? elsif options[:ignore_blank_lines] line.empty? else false end }.collect{|substr| substr.match(/^[ \t]*/).to_s.length}.min end # Find the least indentation of all lines within this string and remove that amount (if any) # Can pass an optional modifier that changes the indentation amount removed def reset_indentation(modifier = 0) indent(-find_least_indentation + modifier) end # Replaces the current string with one that has had its indentation reset # Can pass an optional modifier that changes the indentation amount removed def reset_indentation!(modifier = 0) indent!(-find_least_indentation + modifier) end private def _indent(num = nil, i_char = ' ') # Define number of indentations to use number = num # Default number to 2 if spaces or 1 if other number ||= (i_char == ' ') ? 2 : 1 case when number >= 0 split("\n", -1).collect{|line| (i_char * number) + line}.join("\n") else i_regexp = Regexp.new("^([ \t]|#{i_char})") split("\n", -1).collect do |line| ret_str = String.new(line) number.abs.times do match = ret_str.sub!(i_regexp, '') break unless match end ret_str end.join("\n") end end endindentation-0.1.1/lib/indentation/meta_info.rb0000644000004100000410000000743412256156015021440 0ustar www-datawww-data# must not have the word m-o-d-u-l-e above the next line (so that a Regexp can figure out the m-o-d-u-l-e name) module Indentation # For more information about meta_info.rb, please see project Foundation, lib/Foundation/meta_info.rb # SUGGESTION: Treat "Optional" as meaning "can be nil", and define all constants, even if the value happens to be nil. # Required String GEM_NAME = "indentation" # Required String VERSION = '0.1.1' # Optional String or Array of Strings AUTHORS = ["Sam Dana"] # Optional String or Array of Strings EMAILS = ["s.dana@prometheuscomputing.com"] # Optional String HOMEPAGE = "http://samueldana.github.com/indentation/" # Required String SUMMARY = %q{A library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings.} # Optional String DESCRIPTION = SUMMARY # Required Symbol # This specifies the language the project is written in (not including the version, which is in LANGUAGE_VERSION). # A project should only have one LANGUAGE (not including, for example DSLs such as templating languages). # If a project has more than one language (not including DSLs), it should be split. # TEMPORARY EXCEPTION: see :frankenstein choice below. # The reason is that mixing up languages in one project complicates packaging, deployment, metrics, directory structure, and many other aspects of development. # Choices are currently: # * :ruby (implies packaging as gem - contains ZERO java code) # * :java (implies packaging as jar, ear, war, sar, etc (depending on TYPE) - contains ZERO ruby code, with exception of meta_info.rb) # * :frankenstein (implies packaging as gem - contains BOTH ruby and java code - will probably deprecate this in favor of two separate projects) LANGUAGE = :ruby # This differs from Runtime version - this specifies the version of the syntax of LANGUAGE LANGUAGE_VERSION = ['> 1.8.1', '< 1.9.3'] # This is different from aGem::Specification.platform, which appears to be concerned with OS. # This defines which implentation of Ruby, Java, etc can be used. # Required Hash, in same format as DEPENDENCIES_RUBY. # The version part is used by required_ruby_version # Allowable keys depend on LANGUAGE. They are in VALID__RUNTIMES RUNTIME_VERSIONS = { :mri => ['> 1.8.1', '< 1.9.3'], :jruby => ['1.6.4'] } # Required Symbol # Choices are currently: # * :library - reusable functionality, not intended to stand alone # * :utility - intended for use on command line # * :web_app - an application that uses a web browser for it's GUI # * :service - listens on some port. May include command line tools to manage the server. # * :gui - has a Swing, Fox, WXwidget, etc GUI TYPE = :library # Optional Hashes - if nil, presumed to be empty. # There may be additional dependencies, for platforms (such as :maglev) other than :mri and :jruby # In the case of JRuby platform Ruby code that depends on a third party Java jar, where do we specify that? # Trying to install this under Ruby 1.8.7 I get: # Error installing MM-0.0.6.gem: # simplecov requires multi_json (~> 1.0.3, runtime) # So I have commented out some dependencies. # FIX: these dependency collections need to be specific to a LANGUAGE_VERSION. Maybe RUNTIME_VERSIONS as well. # We also need :simplecov => nil, but only on Ruby > 1.8 } DEPENDENCIES_RUBY = { } DEPENDENCIES_MRI = { } DEPENDENCIES_JRUBY = { } DEVELOPMENT_DEPENDENCIES_RUBY = { } # test-unit is reccomended but not required (color codes Test::Unit test results) DEVELOPMENT_DEPENDENCIES_MRI = { } DEVELOPMENT_DEPENDENCIES_JRUBY = { } # An Array of strings that YARD will interpret as regular expressions of files to be excluded. YARD_EXCLUDE = [] endindentation-0.1.1/lib/indentation.rb0000644000004100000410000000010612256156015017464 0ustar www-datawww-datarequire 'indentation/string_mod.rb' require 'indentation/array_mod.rb'indentation-0.1.1/metadata.yml0000644000004100000410000000266512256156015016374 0ustar www-datawww-data--- !ruby/object:Gem::Specification name: indentation version: !ruby/object:Gem::Version version: 0.1.1 platform: ruby authors: - Sam Dana autorequire: bindir: bin cert_chain: [] date: 2013-10-09 00:00:00.000000000 Z dependencies: [] description: A library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings. email: - s.dana@prometheuscomputing.com executables: [] extensions: [] extra_rdoc_files: [] files: - README.rdoc - gemspec - lib/indentation.rb - lib/indentation/array_mod.rb - lib/indentation/meta_info.rb - lib/indentation/string_mod.rb - spec/.rspec - spec/indentation_spec.rb - spec/rdoc_examples_spec.rb - spec/spec_helper.rb homepage: http://samueldana.github.com/indentation/ licenses: [] metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.0.3 signing_key: specification_version: 4 summary: A library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings. test_files: - spec/indentation_spec.rb - spec/rdoc_examples_spec.rb - spec/spec_helper.rb has_rdoc: indentation-0.1.1/gemspec0000644000004100000410000000160312256156015015426 0ustar www-datawww-data # DO NOT HAND MODIFY # This file was generated programmatically by MM Gem::Specification.new do |s| s.name = "indentation" s.version = "0.0.7" s.authors = ["Sam Dana"] s.email = ["s.dana@prometheuscomputing.com"] s.homepage = "http://samueldana.github.com/indentation/" s.summary = "A library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings." s.description = "A library of extensions to Ruby's Array and String classes that allow indentation manipulation of Strings and Arrays of Strings." s.require_paths = ['lib'] s.files = ["README.rdoc", "lib/indentation.rb", "lib/indentation/array_mod.rb", "lib/indentation/meta_info.rb", "lib/indentation/string_mod.rb", "spec/.rspec", "spec/indentation_spec.rb", "spec/spec_helper.rb"] s.test_files = ["spec/indentation_spec.rb", "spec/spec_helper.rb"] s.executables = [] endindentation-0.1.1/checksums.yaml.gz0000444000004100000410000000064712256156015017355 0ustar www-datawww-dataURA@+'8=zYҎP%u3٠v9,j 9{jW{˷G/m'kTj\ Hyzq2 ro7BuquYXEH*;*sKX7)X$ciM7Zߜ!ع'knFfBMeq66Ok-m.Gβ[dOzBdF&#TWv܀ĄuY~5΃nx LIj(lE w٤6rT^QHĥ^:.ahmC0 "0y4neshw<,Q:EʼnxrIl