adhearsion-loquacious 1.9.2 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --colour
3
+ --tty
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/Guardfile CHANGED
@@ -1,5 +1,5 @@
1
1
  guard 'rspec', :version => 2, :cli => '--format documentation' do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec/" }
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec/" }
5
5
  end
data/Rakefile CHANGED
@@ -1,30 +1,10 @@
1
+ # -*- ruby -*-
2
+ require 'bundler/gem_tasks'
3
+ require 'bundler/setup'
1
4
 
2
- begin
3
- require 'bones'
4
- rescue LoadError
5
- abort '### please install the "bones" gem ###'
6
- end
5
+ task :default => :spec
7
6
 
8
- task :default => 'spec:run'
9
- task 'gem:release' => 'spec:run'
7
+ require 'rspec/core/rake_task'
8
+ RSpec::Core::RakeTask.new :spec
10
9
 
11
- Bones {
12
- name 'adhearsion-loquacious'
13
- authors 'Tim Pease', 'Adhearsion Team'
14
- email 'tim.pease@gmail.com', 'all@adhearsion.com'
15
- url 'http://rubygems.org/gems/adhearsion-loquacious'
16
- readme_file 'README.rdoc'
17
- spec.opts << '--color'
18
- use_gmail
19
-
20
- depend_on 'rspec', '~> 2.6', :development => true
21
- }
22
-
23
- task 'ann:prereqs' do
24
- Bones.config.name = 'Adhearsion-Loquacious'
25
- end
26
-
27
- # depending on bones (even as a development dependency) creates a circular
28
- # reference that prevents the auto install of loquacious when instsalling
29
- # bones
30
- ::Bones.config.gem._spec.dependencies.delete_if {|d| d.name == 'bones'}
10
+ require 'yard'
@@ -51,12 +51,6 @@ module Loquacious
51
51
  end
52
52
  alias :help :help_for
53
53
 
54
- # Returns the version string for the library.
55
- #
56
- def version
57
- @version ||= File.read(path('version.txt')).strip
58
- end
59
-
60
54
  # Returns the library path for the module. If any arguments are given,
61
55
  # they will be joined to the end of the libray path using
62
56
  # <tt>File.join</tt>.
@@ -161,5 +155,6 @@ Loquacious.libpath {
161
155
  require 'loquacious/configuration'
162
156
  require 'loquacious/configuration/iterator'
163
157
  require 'loquacious/configuration/help'
158
+ require 'loquacious/configuration/help/string_presenter'
164
159
  }
165
160
 
@@ -1,4 +1,3 @@
1
-
2
1
  require 'pp'
3
2
  require 'stringio'
4
3
 
@@ -185,7 +184,7 @@ class Loquacious::Configuration
185
184
  desc = desc.gsub(%r/([^\n]+)/,
186
185
  self.__send__(@colors[:description], '\1'))
187
186
  end
188
- @io.puts(desc.indent(@desc_leader))
187
+ @io.puts(StringPresenter.new(desc).indent(@desc_leader))
189
188
  end
190
189
 
191
190
  @io.puts(format_name(node, show_value))
@@ -197,7 +196,7 @@ class Loquacious::Configuration
197
196
  # also be included in the returned string.
198
197
  #
199
198
  def format_name( node, show_value )
200
- name = node.name.reduce @name_length
199
+ name = StringPresenter.new(node.name).reduce @name_length
201
200
  return @name_format % name if node.config? or !show_value
202
201
 
203
202
  sio = StringIO.new
@@ -0,0 +1,53 @@
1
+ require 'delegate'
2
+
3
+ class Loquacious::Configuration
4
+ class Help
5
+ class StringPresenter < SimpleDelegator
6
+
7
+ # call-seq:
8
+ # reduce width, ellipses = '...' #=> string
9
+ #
10
+ # Reduce the size of the current string to the given _width_ by removing
11
+ # characters from the middle of the string and replacing them with
12
+ # _ellipses_. If the _width_ is greater than the length of the string, the
13
+ # string is returned unchanged. If the _width_ is less than the length of
14
+ # the _ellipses_, then the _ellipses_ are returned.
15
+ #
16
+ def reduce(width, ellipses = '...')
17
+ raise ArgumentError, "width cannot be negative: #{width}" if width < 0
18
+
19
+ return to_s if length <= width
20
+
21
+ remove = length - width + ellipses.length
22
+ return ellipses.dup if remove >= length
23
+
24
+ left_end = (length + 1 - remove) / 2
25
+ right_start = left_end + remove
26
+
27
+ left = self[0,left_end]
28
+ right = self[right_start,length-right_start]
29
+
30
+ left << ellipses << right
31
+ end
32
+
33
+ # call-seq:
34
+ # StringPresenter.new("foo").indent 2 #=> " foo"
35
+ # StringPresenter.new("foo").indent '# ' #=> "# foo"
36
+ #
37
+ # Indent the string by the given number of spaces. Alternately, if a
38
+ # leader string is given it will be used to indent with instead of spaces.
39
+ # Indentation is performed at the beginning of the string and after every
40
+ # newline character.
41
+ #
42
+ # "foo\nbar".indent 2 #=> " foo\n bar"
43
+ #
44
+ def indent(leader)
45
+ leader =
46
+ Numeric === leader ? ' ' * leader.to_i : leader.to_s
47
+ str = self.gsub "\n", "\n"+leader
48
+ str.insert 0, leader
49
+ str
50
+ end
51
+ end
52
+ end
53
+ end
@@ -1,51 +1,5 @@
1
-
2
1
  class String
3
2
 
4
- # call-seq:
5
- # reduce( width, ellipses = '...' ) #=> string
6
- #
7
- # Reduce the size of the current string to the given _width_ by removing
8
- # characters from the middle of the string and replacing them with
9
- # _ellipses_. If the _width_ is greater than the length of the string, the
10
- # string is returned unchanged. If the _width_ is less than the length of
11
- # the _ellipses_, then the _ellipses_ are returned.
12
- #
13
- def reduce( width, ellipses = '...')
14
- raise ArgumentError, "width cannot be negative: #{width}" if width < 0
15
-
16
- return self if length <= width
17
-
18
- remove = length - width + ellipses.length
19
- return ellipses.dup if remove >= length
20
-
21
- left_end = (length + 1 - remove) / 2
22
- right_start = left_end + remove
23
-
24
- left = self[0,left_end]
25
- right = self[right_start,length-right_start]
26
-
27
- left << ellipses << right
28
- end
29
-
30
- # call-seq:
31
- # "foo".indent( 2 ) #=> " foo"
32
- # "foo".indent( '# ' ) #=> "# foo"
33
- #
34
- # Indent the string by the given number of spaces. Alternately, if a
35
- # leader string is given it will be used to indent with instead of spaces.
36
- # Indentation is performed at the beginning of the string and after every
37
- # newline character.
38
- #
39
- # "foo\nbar".indent( 2 ) #=> " foo\n bar"
40
- #
41
- def indent( leader )
42
- leader =
43
- Numeric === leader ? ' ' * leader.to_i : leader.to_s
44
- str = self.gsub("\n", "\n"+leader)
45
- str.insert(0, leader)
46
- str
47
- end
48
-
49
3
  # call-seq:
50
4
  # " | foo\n | bar".gutter! #=> " foo\n bar"
51
5
  #
@@ -70,6 +24,4 @@ class String
70
24
  def gutter
71
25
  self.dup.gutter!
72
26
  end
73
- end # class String
74
-
75
- # EOF
27
+ end
@@ -0,0 +1,3 @@
1
+ module Loquacious
2
+ VERSION = '1.9.3'
3
+ end
@@ -1,32 +1,55 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "loquacious/version"
2
4
 
3
5
  Gem::Specification.new do |s|
4
- s.name = "loquacious"
5
- s.version = "1.9.1"
6
+ s.name = "adhearsion-loquacious"
7
+ s.version = Loquacious::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Tim Pease"]
10
+ s.email = "tim.pease@gmail.com"
11
+ s.homepage = "http://rubygems.org/gems/loquacious"
12
+ s.summary = "Descriptive configuration files for Ruby written in Ruby."
13
+ s.description = %Q{Descriptive configuration files for Ruby written in Ruby.
14
+ Loquacious provides a very open configuration system written in ruby and descriptions for each configuration attribute.
15
+ The attributes and descriptions can be iterated over allowing for helpful information about those attributes to be displayed to the user.
16
+ In the simple case we have a file something like:
17
+ Loquacious.configuration_for('app') {
18
+ name 'value', :desc => "Defines the name"
19
+ foo 'bar', :desc => "FooBar"
20
+ id 42, :desc => "Ara T. Howard"
21
+ }
22
+ Which can be loaded via the standard Ruby loading mechanisms
23
+ load 'config/app.rb'
24
+ The attributes and their descriptions can be printed by using a Help object
25
+ help = Loquacious.help_for('app')
26
+ help.show :values => true # show the values for the attributes, too
27
+ Descriptions are optional, and configurations can be nested arbitrarily deep.
28
+ Loquacious.configuration_for('nested') {
29
+ desc "The outermost level"
30
+ a {
31
+ desc "One more level in"
32
+ b {
33
+ desc "Finally, a real value"
34
+ c 'value'
35
+ }
36
+ }
37
+ }
38
+ config = Loquacious.configuration_for 'nested'
39
+ p config.a.b.c #=> "value"
40
+ And as you can see, descriptions can either be given inline after the value or they can appear above the attribute and value on their own line.
41
+ }
6
42
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Tim Pease"]
9
- s.date = "2012-01-16"
10
- s.description = "Descriptive configuration files for Ruby written in Ruby.\n\nLoquacious provides a very open configuration system written in ruby and\ndescriptions for each configuration attribute. The attributes and descriptions\ncan be iterated over allowing for helpful information about those attributes to\nbe displayed to the user.\n\nIn the simple case we have a file something like\n\n Loquacious.configuration_for('app') {\n name 'value', :desc => \"Defines the name\"\n foo 'bar', :desc => \"FooBar\"\n id 42, :desc => \"Ara T. Howard\"\n }\n\nWhich can be loaded via the standard Ruby loading mechanisms\n\n Kernel.load 'config/app.rb'\n\nThe attributes and their descriptions can be printed by using a Help object\n\n help = Loquacious.help_for('app')\n help.show :values => true # show the values for the attributes, too\n\nDescriptions are optional, and configurations can be nested arbitrarily deep.\n\n Loquacious.configuration_for('nested') {\n desc \"The outermost level\"\n a {\n desc \"One more level in\"\n b {\n desc \"Finally, a real value\"\n c 'value'\n }\n }\n }\n\n config = Loquacious.configuration_for('nested')\n\n p config.a.b.c #=> \"value\"\n\nAnd as you can see, descriptions can either be given inline after the value or\nthey can appear above the attribute and value on their own line."
11
- s.email = "tim.pease@gmail.com"
12
- s.extra_rdoc_files = ["History.txt", "README.rdoc", "lib/.loquacious.rb.swp", "lib/loquacious/.configuration.rb.swp"]
13
- s.files = [".Rakefile.swp", ".gitignore", "History.txt", "README.rdoc", "Rakefile", "examples/gutters.rb", "examples/nested.rb", "examples/simple.rb", "lib/.loquacious.rb.swp", "lib/loquacious.rb", "lib/loquacious/.configuration.rb.swp", "lib/loquacious/configuration.rb", "lib/loquacious/configuration/help.rb", "lib/loquacious/configuration/iterator.rb", "lib/loquacious/core_ext/string.rb", "lib/loquacious/undefined.rb", "spec/configuration_spec.rb", "spec/help_spec.rb", "spec/iterator_spec.rb", "spec/loquacious_spec.rb", "spec/spec_helper.rb", "spec/string_spec.rb", "version.txt"]
14
- s.homepage = "http://rubygems.org/gems/loquacious"
15
- s.rdoc_options = ["--main", "README.rdoc"]
43
+ s.files = `git ls-files`.split("\n")
44
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
45
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
46
  s.require_paths = ["lib"]
17
- s.rubyforge_project = "loquacious"
18
- s.rubygems_version = "1.8.10"
19
- s.summary = "Descriptive configuration files for Ruby written in Ruby."
20
47
 
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 3
23
-
24
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<rspec>, ["~> 2.6"])
26
- else
27
- s.add_dependency(%q<rspec>, ["~> 2.6"])
28
- end
29
- else
30
- s.add_dependency(%q<rspec>, ["~> 2.6"])
31
- end
48
+ s.add_development_dependency 'rake'
49
+ s.add_development_dependency 'bundler', ["~> 1.0"]
50
+ s.add_development_dependency 'guard-rspec'
51
+ s.add_development_dependency 'guard-rspec'
52
+ s.add_development_dependency 'rspec', ["~> 2.7.0"]
53
+ s.add_development_dependency 'ruby_gntp'
54
+ s.add_development_dependency 'yard'
32
55
  end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe Loquacious::Configuration::Help::StringPresenter do
4
+
5
+ it "can be created from a string and return a string" do
6
+ presenter = described_class.new "foobar"
7
+ presenter.to_s.should be == "foobar"
8
+ end
9
+
10
+ it "reduces to a size by replacing characters from the middle" do
11
+ described_class.new("this is a longish string").reduce(10).should be == "this...ing"
12
+ described_class.new("this is a longish string").reduce(15).should be == "this i...string"
13
+ described_class.new("this is a longish string").reduce(24).should be == "this is a longish string"
14
+
15
+ described_class.new("this is a longish string").reduce(10, '--').should be == "this--ring"
16
+ end
17
+
18
+ it "indents by a given number of spaces" do
19
+ described_class.new("hello").indent(2).should be == " hello"
20
+ described_class.new("hello\nworld").indent(4).should be == " hello\n world"
21
+ described_class.new(" a\nslightly\n longer\n string\n").indent(2).should be == " a\n slightly\n longer\n string\n "
22
+ end
23
+
24
+ it "indents using a leader string" do
25
+ described_class.new("hello").indent("foo ").should be == "foo hello"
26
+ described_class.new("hello\nworld").indent("...").should be == "...hello\n...world"
27
+ described_class.new(" a\nslightly\n longer\n string\n").indent("#").should be == "# a\n#slightly\n# longer\n# string\n#"
28
+ end
29
+ end
@@ -1,5 +1,4 @@
1
-
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
1
+ require 'spec_helper'
3
2
 
4
3
  describe Loquacious::Configuration::Help do
5
4
 
@@ -1,5 +1,4 @@
1
-
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
1
+ require 'spec_helper'
3
2
 
4
3
  describe Loquacious::Configuration::Iterator do
5
4
 
@@ -1,5 +1,4 @@
1
-
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
1
+ require 'spec_helper'
3
2
 
4
3
  describe Loquacious::Configuration do
5
4
  before(:each) do
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe String do
4
+
5
+ it "removes a leading gutter from all lines" do
6
+ str = " | foo"
7
+ result = str.gutter!
8
+ result.should be == " foo"
9
+ result.should equal(str)
10
+
11
+ str = <<-STRING
12
+ | And this is where gutters really shine!
13
+ | HERE DOCS!!
14
+ ||they are the best
15
+ |
16
+ | You can indent stuff nicely and all that
17
+ |all done now
18
+ STRING
19
+
20
+ str.gutter!
21
+ str.should be == " And this is where gutters really shine!\n HERE DOCS!!\n|they are the best\n\n You can indent stuff nicely and all that\nall done now\n"
22
+ end
23
+
24
+ it "creates a copy when removing a leading gutter" do
25
+ str = " | foo"
26
+ result = str.gutter
27
+ result.should be == " foo"
28
+ result.should_not equal(str)
29
+ end
30
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec_helper', File.dirname(__FILE__))
1
+ require 'spec_helper'
2
2
 
3
3
  describe Loquacious::Utility do
4
4
  let(:obj) {
@@ -1,15 +1,10 @@
1
-
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
1
+ require 'spec_helper'
3
2
 
4
3
  describe Loquacious do
5
4
  before(:all) do
6
5
  @root_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
7
6
  end
8
7
 
9
- it "should report a version number" do
10
- Loquacious.version.should match(%r/\d+\.\d+\.\d+/)
11
- end
12
-
13
8
  it "finds things releative to 'lib'" do
14
9
  Loquacious.libpath(%w[loquacious config.rb]).should be == File.join(@root_dir, %w[lib loquacious config.rb])
15
10
  end
@@ -1,26 +1,19 @@
1
+ # encoding: utf-8
1
2
 
2
- require File.expand_path('../lib/loquacious', File.dirname(__FILE__))
3
+ %w{
4
+ bundler/setup
5
+ loquacious
6
+ }.each { |f| require f }
3
7
 
4
- RSpec.configure do |config|
5
- # Use color in STDOUT
6
- config.color_enabled = true
8
+ Bundler.require(:default, :test) if defined?(Bundler)
7
9
 
8
- # Use color not only in STDOUT but also in pagers and files
9
- config.tty = true
10
+ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }
10
11
 
11
- # Use the specified formatter
12
- config.formatter = :documentation # :progress, :html, :textmate
13
-
14
- # == Mock Framework
15
- #
16
- # RSpec uses it's own mocking framework by default. If you prefer to
17
- # use mocha, flexmock or RR, uncomment the appropriate line:
18
- #
19
- # config.mock_with :mocha
20
- # config.mock_with :flexmock
21
- # config.mock_with :rr
22
-
23
- Loquacious::Undefined.io = StringIO.new
12
+ RSpec.configure do |config|
13
+ config.treat_symbols_as_metadata_keys_with_true_values = true
14
+ config.filter_run :focus => true
15
+ config.run_all_when_everything_filtered = true
16
+ config.color_enabled = true
24
17
 
25
18
  config.before :each do
26
19
  Loquacious::Undefined.io.clear
@@ -39,32 +32,6 @@ RSpec.configure do |config|
39
32
  }
40
33
  end
41
34
  end
42
- end
43
-
44
- class StringIO
45
- alias :_readline :readline
46
- def readline
47
- @pos ||= 0
48
- seek @pos
49
- line = _readline
50
- @pos = tell
51
- return line
52
- rescue EOFError
53
- nil
54
- end
55
-
56
- def clear
57
- @pos = 0
58
- seek 0
59
- truncate 0
60
- end
61
35
 
62
- def to_s
63
- @pos = tell
64
- seek 0
65
- str = read
66
- seek @pos
67
- return str
68
- end
36
+ Loquacious::Undefined.io = StringIO.new
69
37
  end
70
-
@@ -0,0 +1,26 @@
1
+ class StringIO
2
+ alias :_readline :readline
3
+ def readline
4
+ @pos ||= 0
5
+ seek @pos
6
+ line = _readline
7
+ @pos = tell
8
+ return line
9
+ rescue EOFError
10
+ nil
11
+ end
12
+
13
+ def clear
14
+ @pos = 0
15
+ seek 0
16
+ truncate 0
17
+ end
18
+
19
+ def to_s
20
+ @pos = tell
21
+ seek 0
22
+ str = read
23
+ seek @pos
24
+ return str
25
+ end
26
+ end
metadata CHANGED
@@ -1,84 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adhearsion-loquacious
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tim Pease
9
- - Adhearsion Team
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-01-18 00:00:00.000000000 Z
12
+ date: 2012-06-04 00:00:00.000000000 Z
14
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: guard-rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: guard-rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
15
78
  - !ruby/object:Gem::Dependency
16
79
  name: rspec
17
- requirement: &2164540760 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.7.0
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
18
89
  none: false
19
90
  requirements:
20
91
  - - ~>
21
92
  - !ruby/object:Gem::Version
22
- version: '2.6'
93
+ version: 2.7.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: ruby_gntp
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: yard
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
23
118
  type: :development
24
119
  prerelease: false
25
- version_requirements: *2164540760
26
- description: ! "Descriptive configuration files for Ruby written in Ruby.\n\nLoquacious
27
- provides a very open configuration system written in ruby and\ndescriptions for
28
- each configuration attribute. The attributes and descriptions\ncan be iterated over
29
- allowing for helpful information about those attributes to\nbe displayed to the
30
- user.\n\nIn the simple case we have a file something like\n\n Loquacious.configuration_for('app')
31
- {\n name 'value', :desc => \"Defines the name\"\n foo 'bar', :desc => \"FooBar\"\n
32
- \ id 42, :desc => \"Ara T. Howard\"\n }\n\nWhich can be loaded via the
33
- standard Ruby loading mechanisms\n\n Kernel.load 'config/app.rb'\n\nThe attributes
34
- and their descriptions can be printed by using a Help object\n\n help = Loquacious.help_for('app')\n
35
- \ help.show :values => true # show the values for the attributes, too\n\nDescriptions
36
- are optional, and configurations can be nested arbitrarily deep.\n\n Loquacious.configuration_for('nested')
37
- {\n desc \"The outermost level\"\n a {\n desc \"One more level in\"\n
38
- \ b {\n desc \"Finally, a real value\"\n c 'value'\n }\n
39
- \ }\n }\n\n config = Loquacious.configuration_for('nested')\n\n p config.a.b.c
40
- \ #=> \"value\"\n\nAnd as you can see, descriptions can either be given inline after
41
- the value or\nthey can appear above the attribute and value on their own line."
42
- email:
43
- - tim.pease@gmail.com
44
- - all@adhearsion.com
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: ! "Descriptive configuration files for Ruby written in Ruby.\n Loquacious
127
+ provides a very open configuration system written in ruby and descriptions for each
128
+ configuration attribute.\n The attributes and descriptions can be iterated over
129
+ allowing for helpful information about those attributes to be displayed to the user.\n
130
+ \ In the simple case we have a file something like:\n Loquacious.configuration_for('app')
131
+ {\n name 'value', :desc => \"Defines the name\"\n foo 'bar', :desc
132
+ => \"FooBar\"\n id 42, :desc => \"Ara T. Howard\"\n }\n Which
133
+ can be loaded via the standard Ruby loading mechanisms\n load 'config/app.rb'\n
134
+ \ The attributes and their descriptions can be printed by using a Help object\n
135
+ \ help = Loquacious.help_for('app')\n help.show :values => true #
136
+ show the values for the attributes, too\n Descriptions are optional, and configurations
137
+ can be nested arbitrarily deep.\n Loquacious.configuration_for('nested')
138
+ {\n desc \"The outermost level\"\n a {\n desc \"One
139
+ more level in\"\n b {\n desc \"Finally, a real value\"\n
140
+ \ c 'value'\n }\n }\n }\n config =
141
+ Loquacious.configuration_for 'nested'\n p config.a.b.c #=> \"value\"\n And
142
+ as you can see, descriptions can either be given inline after the value or they
143
+ can appear above the attribute and value on their own line.\n "
144
+ email: tim.pease@gmail.com
45
145
  executables: []
46
146
  extensions: []
47
- extra_rdoc_files:
48
- - History.txt
49
- - README.rdoc
147
+ extra_rdoc_files: []
50
148
  files:
51
149
  - .gitignore
150
+ - .rspec
151
+ - Gemfile
52
152
  - Guardfile
53
153
  - History.txt
54
154
  - README.rdoc
55
155
  - Rakefile
56
- - adhearsion-loquacious.gemspec
57
156
  - examples/gutters.rb
58
157
  - examples/nested.rb
59
158
  - examples/simple.rb
60
159
  - lib/loquacious.rb
61
160
  - lib/loquacious/configuration.rb
62
161
  - lib/loquacious/configuration/help.rb
162
+ - lib/loquacious/configuration/help/string_presenter.rb
63
163
  - lib/loquacious/configuration/iterator.rb
64
164
  - lib/loquacious/core_ext/string.rb
65
165
  - lib/loquacious/undefined.rb
66
166
  - lib/loquacious/utility.rb
167
+ - lib/loquacious/version.rb
67
168
  - loquacious.gemspec
68
- - spec/configuration_spec.rb
69
- - spec/help_spec.rb
70
- - spec/iterator_spec.rb
169
+ - spec/loquacious/configuration/help/string_presenter_spec.rb
170
+ - spec/loquacious/configuration/help_spec.rb
171
+ - spec/loquacious/configuration/iterator_spec.rb
172
+ - spec/loquacious/configuration_spec.rb
173
+ - spec/loquacious/string_spec.rb
174
+ - spec/loquacious/utility_spec.rb
71
175
  - spec/loquacious_spec.rb
72
176
  - spec/spec_helper.rb
73
- - spec/string_spec.rb
74
- - spec/utility_spec.rb
75
- - version.txt
76
- homepage: http://rubygems.org/gems/adhearsion-loquacious
177
+ - spec/support/stringio.rb
178
+ homepage: http://rubygems.org/gems/loquacious
77
179
  licenses: []
78
180
  post_install_message:
79
- rdoc_options:
80
- - --main
81
- - README.rdoc
181
+ rdoc_options: []
82
182
  require_paths:
83
183
  - lib
84
184
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -87,16 +187,32 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
187
  - - ! '>='
88
188
  - !ruby/object:Gem::Version
89
189
  version: '0'
190
+ segments:
191
+ - 0
192
+ hash: -3892400070251149352
90
193
  required_rubygems_version: !ruby/object:Gem::Requirement
91
194
  none: false
92
195
  requirements:
93
196
  - - ! '>='
94
197
  - !ruby/object:Gem::Version
95
198
  version: '0'
199
+ segments:
200
+ - 0
201
+ hash: -3892400070251149352
96
202
  requirements: []
97
- rubyforge_project: adhearsion-loquacious
98
- rubygems_version: 1.8.10
203
+ rubyforge_project:
204
+ rubygems_version: 1.8.21
99
205
  signing_key:
100
206
  specification_version: 3
101
207
  summary: Descriptive configuration files for Ruby written in Ruby.
102
- test_files: []
208
+ test_files:
209
+ - spec/loquacious/configuration/help/string_presenter_spec.rb
210
+ - spec/loquacious/configuration/help_spec.rb
211
+ - spec/loquacious/configuration/iterator_spec.rb
212
+ - spec/loquacious/configuration_spec.rb
213
+ - spec/loquacious/string_spec.rb
214
+ - spec/loquacious/utility_spec.rb
215
+ - spec/loquacious_spec.rb
216
+ - spec/spec_helper.rb
217
+ - spec/support/stringio.rb
218
+ has_rdoc:
@@ -1,32 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = "adhearsion-loquacious"
5
- s.version = "1.9.2"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Tim Pease", "Adhearsion Team"]
9
- s.date = "2012-01-18"
10
- s.description = "Descriptive configuration files for Ruby written in Ruby.\n\nLoquacious provides a very open configuration system written in ruby and\ndescriptions for each configuration attribute. The attributes and descriptions\ncan be iterated over allowing for helpful information about those attributes to\nbe displayed to the user.\n\nIn the simple case we have a file something like\n\n Loquacious.configuration_for('app') {\n name 'value', :desc => \"Defines the name\"\n foo 'bar', :desc => \"FooBar\"\n id 42, :desc => \"Ara T. Howard\"\n }\n\nWhich can be loaded via the standard Ruby loading mechanisms\n\n Kernel.load 'config/app.rb'\n\nThe attributes and their descriptions can be printed by using a Help object\n\n help = Loquacious.help_for('app')\n help.show :values => true # show the values for the attributes, too\n\nDescriptions are optional, and configurations can be nested arbitrarily deep.\n\n Loquacious.configuration_for('nested') {\n desc \"The outermost level\"\n a {\n desc \"One more level in\"\n b {\n desc \"Finally, a real value\"\n c 'value'\n }\n }\n }\n\n config = Loquacious.configuration_for('nested')\n\n p config.a.b.c #=> \"value\"\n\nAnd as you can see, descriptions can either be given inline after the value or\nthey can appear above the attribute and value on their own line."
11
- s.email = ["tim.pease@gmail.com", "all@adhearsion.com"]
12
- s.extra_rdoc_files = ["History.txt", "README.rdoc"]
13
- s.files = [".gitignore", "Guardfile", "History.txt", "README.rdoc", "Rakefile", "examples/gutters.rb", "examples/nested.rb", "examples/simple.rb", "lib/loquacious.rb", "lib/loquacious/configuration.rb", "lib/loquacious/configuration/help.rb", "lib/loquacious/configuration/iterator.rb", "lib/loquacious/core_ext/string.rb", "lib/loquacious/undefined.rb", "lib/loquacious/utility.rb", "loquacious.gemspec", "spec/configuration_spec.rb", "spec/help_spec.rb", "spec/iterator_spec.rb", "spec/loquacious_spec.rb", "spec/spec_helper.rb", "spec/string_spec.rb", "spec/utility_spec.rb", "version.txt"]
14
- s.homepage = "http://rubygems.org/gems/adhearsion-loquacious"
15
- s.rdoc_options = ["--main", "README.rdoc"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = "adhearsion-loquacious"
18
- s.rubygems_version = "1.8.10"
19
- s.summary = "Descriptive configuration files for Ruby written in Ruby."
20
-
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 3
23
-
24
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<rspec>, ["~> 2.6"])
26
- else
27
- s.add_dependency(%q<rspec>, ["~> 2.6"])
28
- end
29
- else
30
- s.add_dependency(%q<rspec>, ["~> 2.6"])
31
- end
32
- end
@@ -1,53 +0,0 @@
1
-
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
3
-
4
- describe String do
5
-
6
- it "reduces to a size by replacing characters from the middle" do
7
- "this is a longish string".reduce(10).should be == "this...ing"
8
- "this is a longish string".reduce(15).should be == "this i...string"
9
- "this is a longish string".reduce(24).should be == "this is a longish string"
10
-
11
- "this is a longish string".reduce(10, '--').should be == "this--ring"
12
- end
13
-
14
- it "indents by a given number of spaces" do
15
- "hello".indent(2).should be == " hello"
16
- "hello\nworld".indent(4).should be == " hello\n world"
17
- " a\nslightly\n longer\n string\n".indent(2).should be == " a\n slightly\n longer\n string\n "
18
- end
19
-
20
- it "indents using a leader string" do
21
- "hello".indent("foo ").should be == "foo hello"
22
- "hello\nworld".indent("...").should be == "...hello\n...world"
23
- " a\nslightly\n longer\n string\n".indent("#").should be == "# a\n#slightly\n# longer\n# string\n#"
24
- end
25
-
26
- it "removes a leading gutter from all lines" do
27
- str = " | foo"
28
- result = str.gutter!
29
- result.should be == " foo"
30
- result.should equal(str)
31
-
32
- str = <<-STRING
33
- | And this is where gutters really shine!
34
- | HERE DOCS!!
35
- ||they are the best
36
- |
37
- | You can indent stuff nicely and all that
38
- |all done now
39
- STRING
40
-
41
- str.gutter!
42
- str.should be == " And this is where gutters really shine!\n HERE DOCS!!\n|they are the best\n\n You can indent stuff nicely and all that\nall done now\n"
43
- end
44
-
45
- it "creates a copy when removing a leading gutter" do
46
- str = " | foo"
47
- result = str.gutter
48
- result.should be == " foo"
49
- result.should_not equal(str)
50
- end
51
- end
52
-
53
- # EOF
@@ -1 +0,0 @@
1
- 1.9.2