ander 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/ander.rb +14 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjNlNGQ5MjM4ODdjYTZkOTU5ZWQwZTY1YThlMzE3YWE5Y2U5NWJlNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDJlNjI2NmVlZjc1ZmQ0ZjU3NDJiYjhiYTRmNTI3Y2ViMDA3YWQwMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDZjZTYwNWE2ZDk3MzM2OGU4OGY4NjRlYTllNzc0YTk0MDI1NDRkZDZjYWNl
|
10
|
+
ZTE4M2YxNWZkNzg0YTE0NzJkNTIwZWJmNDAwNWQ3M2I1NGZjOGQ0MmZkYWM0
|
11
|
+
ODkyMjVkMGZmM2VjM2EzNTAxYjVkZmU0MWQwNjdkMzNkOTI2YmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODA3ZWYwZDY1YjJkOGFiZjFkNDVmMTNlYWE5NGZmNjM4MWQ0OTEzNTEyMjdm
|
14
|
+
YWYxODQ1YjVmNzQ4OTcxYzZiZTgyZGQyNTMyOTdjNzdiOTk3OGViOTA4MGEx
|
15
|
+
OWNiYzE4ZGZjNmRmYzAyNjc0MDY4NjU5YjIxYzQ5YmY0NWZjNmI=
|
data/lib/ander.rb
CHANGED
@@ -11,31 +11,34 @@ class Ander
|
|
11
11
|
# Include rspec, rails_spec and simplecov in Gemfile
|
12
12
|
puts "\nAdding rspec, rspec-rails and simplecov to the Gemfile"
|
13
13
|
# Check if any gems already exists in Gemfile
|
14
|
+
rspec = false
|
15
|
+
rspec_rails = false
|
16
|
+
simplecov = false
|
14
17
|
open('Gemfile', 'r') { |f|
|
15
18
|
x = f.readlines
|
16
19
|
x.each do |i|
|
17
20
|
if i.include? "'rspec'"
|
18
|
-
|
21
|
+
rspec = true
|
19
22
|
end
|
20
23
|
if i.include? "'rspec-rails'"
|
21
|
-
|
24
|
+
rspec_rails = true
|
22
25
|
end
|
23
26
|
if i.include? "'simplecov'"
|
24
|
-
|
27
|
+
simplecov = true
|
25
28
|
end
|
26
29
|
end
|
27
30
|
}
|
28
31
|
# add to Gemfile only for the missing gems
|
29
|
-
unless
|
32
|
+
unless rspec and rspec_rails and simplecov
|
30
33
|
open('Gemfile', 'a') { |f|
|
31
34
|
f.puts 'group :development, :test do'
|
32
|
-
unless
|
35
|
+
unless rspec
|
33
36
|
f.puts " gem 'rspec'"
|
34
37
|
end
|
35
|
-
unless
|
38
|
+
unless rspec_rails
|
36
39
|
f.puts " gem 'rspec-rails'"
|
37
40
|
end
|
38
|
-
unless
|
41
|
+
unless simplecov
|
39
42
|
f.puts " gem 'simplecov'"
|
40
43
|
end
|
41
44
|
f.puts 'end'
|
@@ -71,14 +74,16 @@ class Ander
|
|
71
74
|
end
|
72
75
|
|
73
76
|
def self.modify_spec_helper
|
77
|
+
puts "Adding require 'simplecov' and SimpleCov.Start"
|
74
78
|
open('spec/spec_helper.rb', 'r'){ |f|
|
79
|
+
simple_flag = false
|
75
80
|
@contents = f.readlines
|
76
81
|
@contents.each do |i|
|
77
82
|
if i.include? "require 'simplecov'"
|
78
|
-
|
83
|
+
simple_flag = true
|
79
84
|
end
|
80
85
|
end
|
81
|
-
unless
|
86
|
+
unless simple_flag
|
82
87
|
@contents.each_with_index {|i, index|
|
83
88
|
if i.include? "RSpec.configure do |config|\n"
|
84
89
|
@contents[index] = i + " require 'simplecov'\n SimpleCov.start\n"
|