lovely-rufus 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1 +1,2 @@
1
+ source :rubygems
1
2
  gemspec
data/Gemfile.lock CHANGED
@@ -1,17 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lovely-rufus (0.0.0)
4
+ lovely-rufus (0.0.1)
5
5
 
6
6
  GEM
7
+ remote: http://rubygems.org/
7
8
  specs:
8
- minitest (2.6.1)
9
- rake (0.9.2)
9
+ minitest (2.11.3)
10
+ rake (0.9.2.2)
10
11
 
11
12
  PLATFORMS
12
13
  ruby
13
14
 
14
15
  DEPENDENCIES
16
+ bundler
15
17
  lovely-rufus!
16
18
  minitest (>= 2.3)
17
19
  rake
data/README.md CHANGED
@@ -67,4 +67,4 @@ Lovely Rufus was created as a [Ruby Mendicant University](http://blog.majesticse
67
67
 
68
68
  ---
69
69
 
70
- © MMX-MMXI Piotr Szotkowski <chastell@chastell.net>, licensed under AGPL 3 (see LICENCE)
70
+ © MMX-MMXII Piotr Szotkowski <chastell@chastell.net>, licensed under AGPL 3 (see LICENCE)
@@ -9,6 +9,8 @@ module LovelyRufus class Wrapper
9
9
  end
10
10
 
11
11
  def wrapped max_width = 72
12
+ return @paras.join "\n\n" if @paras.map(&:size).max < max_width
13
+
12
14
  @paras.map do |para|
13
15
  best = wrap_para_to_width para, max_width
14
16
  (max_width - 1).downto 1 do |width|
data/lovely-rufus.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'lovely-rufus'
3
- gem.version = '0.0.0'
3
+ gem.version = '0.0.1'
4
4
  gem.summary = 'lovely-rufus: text wrapper'
5
5
  gem.homepage = 'http://github.com/chastell/lovely-rufus'
6
6
  gem.author = 'Piotr Szotkowski'
@@ -10,6 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.executables = `git ls-files -z -- bin/*`.split("\0").map { |file| File.basename file }
11
11
  gem.test_files = `git ls-files -z -- spec/*`.split "\0"
12
12
 
13
+ gem.add_development_dependency 'bundler'
13
14
  gem.add_development_dependency 'minitest', '>= 2.3'
14
15
  gem.add_development_dependency 'rake'
15
16
  end
@@ -3,9 +3,7 @@
3
3
  require_relative '../spec_helper'
4
4
 
5
5
  module LovelyRufus describe Wrapper do
6
-
7
6
  describe '#wrapped' do
8
-
9
7
  it 'returns properly wrapped input' do
10
8
  YAML.load_file('spec/fixtures/wrapper.yml').each do |wrapping|
11
9
  Wrapper.new(wrapping['input']).wrapped(wrapping['width'] || 72).must_equal wrapping['output']
@@ -20,6 +18,8 @@ module LovelyRufus describe Wrapper do
20
18
  Wrapper.new('> word').wrapped.must_equal '> word'
21
19
  end
22
20
 
21
+ it 'works with empty strings' do
22
+ Wrapper.new("\n").wrapped.must_equal ''
23
+ end
23
24
  end
24
-
25
25
  end end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,6 @@
1
+ require 'bundler/setup'
1
2
  require 'minitest/autorun'
3
+
2
4
  require 'yaml'
3
5
 
4
6
  require_relative '../lib/lovely-rufus'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lovely-rufus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-13 00:00:00.000000000Z
12
+ date: 2012-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: &15366780 !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: *15366780
14
25
  - !ruby/object:Gem::Dependency
15
26
  name: minitest
16
- requirement: &14209880 !ruby/object:Gem::Requirement
27
+ requirement: &15366180 !ruby/object:Gem::Requirement
17
28
  none: false
18
29
  requirements:
19
30
  - - ! '>='
@@ -21,10 +32,10 @@ dependencies:
21
32
  version: '2.3'
22
33
  type: :development
23
34
  prerelease: false
24
- version_requirements: *14209880
35
+ version_requirements: *15366180
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: rake
27
- requirement: &14209440 !ruby/object:Gem::Requirement
38
+ requirement: &15365660 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,7 +43,7 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *14209440
46
+ version_requirements: *15365660
36
47
  description:
37
48
  email: chastell@chastell.net
38
49
  executables:
@@ -75,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
86
  version: '0'
76
87
  requirements: []
77
88
  rubyforge_project:
78
- rubygems_version: 1.8.10
89
+ rubygems_version: 1.8.17
79
90
  signing_key:
80
91
  specification_version: 3
81
92
  summary: ! 'lovely-rufus: text wrapper'
@@ -84,3 +95,4 @@ test_files:
84
95
  - spec/lovely-rufus/executable_spec.rb
85
96
  - spec/lovely-rufus/wrapper_spec.rb
86
97
  - spec/spec_helper.rb
98
+ has_rdoc: