label 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,13 +24,16 @@ module Label
24
24
  processed_lines = []
25
25
 
26
26
  lines.each_with_index do |line, i|
27
- gem = line[/gem ['"](.+?)['"]/, 1]
27
+ matches = line.match /^( *)gem ['"](.+?)['"]/
28
28
 
29
- if gem
29
+ if matches
30
30
  previous_line = lines[i - 1]
31
31
 
32
+ whitespace = matches[1]
33
+ gem = matches[2]
34
+
32
35
  unless previous_line.start_with? "#"
33
- processed_lines << "# #{describe gem}"
36
+ processed_lines << "#{whitespace}# #{describe gem}"
34
37
  end
35
38
  end
36
39
 
@@ -1,3 +1,3 @@
1
1
  module Label
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,7 +1,15 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0'
5
+
3
6
  # Authentication
4
7
  gem 'devise'
5
8
 
6
9
  # Upload files in your Ruby applications, map them to a range of ORMs, store them on different backends.
7
10
  gem 'carrierwave'
11
+
12
+ group :test do
13
+ # BDD for Ruby
14
+ gem 'rspec'
15
+ end
@@ -1,6 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0'
5
+
3
6
  # Authentication
4
7
  gem 'devise'
5
8
 
6
9
  gem 'carrierwave'
10
+
11
+ group :test do
12
+ gem 'rspec'
13
+ end
@@ -5,6 +5,13 @@ describe Label do
5
5
  it "should label unlabelled gems" do
6
6
  expect(File).to receive(:open).with("Gemfile").and_return(StringIO.new fixture("stock_gemfile"))
7
7
 
8
+ expect(subject).to receive(:describe).with("rspec").and_return("BDD for Ruby")
9
+
10
+ expect(subject).to receive(:describe).with("carrierwave").and_return(
11
+ "Upload files in your Ruby applications, map them to a range of ORMs, " +
12
+ "store them on different backends."
13
+ )
14
+
8
15
  expect(subject.process("Gemfile")).to eq fixture("processed_gemfile")
9
16
  end
10
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: label
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -92,7 +92,6 @@ files:
92
92
  - label.gemspec
93
93
  - lib/label.rb
94
94
  - lib/label/version.rb
95
- - spec/fixtures/forced_processed_gemfile
96
95
  - spec/fixtures/processed_gemfile
97
96
  - spec/fixtures/stock_gemfile
98
97
  - spec/label_spec.rb
@@ -112,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
111
  version: '0'
113
112
  segments:
114
113
  - 0
115
- hash: 900634835657267370
114
+ hash: 363269059359041732
116
115
  required_rubygems_version: !ruby/object:Gem::Requirement
117
116
  none: false
118
117
  requirements:
@@ -121,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
120
  version: '0'
122
121
  segments:
123
122
  - 0
124
- hash: 900634835657267370
123
+ hash: 363269059359041732
125
124
  requirements: []
126
125
  rubyforge_project:
127
126
  rubygems_version: 1.8.23
@@ -129,7 +128,6 @@ signing_key:
129
128
  specification_version: 3
130
129
  summary: Label labels the gems in your Gemfile
131
130
  test_files:
132
- - spec/fixtures/forced_processed_gemfile
133
131
  - spec/fixtures/processed_gemfile
134
132
  - spec/fixtures/stock_gemfile
135
133
  - spec/label_spec.rb
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Flexible authentication solution for Rails with Warden
4
- gem 'devise'
5
-
6
- # Upload files in your Ruby applications, map them to a range of ORMs, store them on different backends.
7
- gem 'carrierwave'