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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/ander.rb +14 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzdkZTU5OGNlNjMyYTI0MGVlYTgwMjI3NTc2MmQ4YzFiMWQxNDVhYg==
4
+ MjNlNGQ5MjM4ODdjYTZkOTU5ZWQwZTY1YThlMzE3YWE5Y2U5NWJlNw==
5
5
  data.tar.gz: !binary |-
6
- MmQ2OGE4NTJhNzVjZjEyYjRkN2YwNjc5ODIzNWE5ZGEwZjFmY2M3Yw==
6
+ NDJlNjI2NmVlZjc1ZmQ0ZjU3NDJiYjhiYTRmNTI3Y2ViMDA3YWQwMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzYzY2U2YTgwNzA2ZjlkZjdkMGE1NTg3NzVlOGEzODQ1MzFiYmQ4NjZmOWRi
10
- MjJkOWMzYjI1YmVjNWNlNDNiYjg3YzkwYTNhMmNmNGE3ZTk1ZjJjZDU0MjEw
11
- ZmI5NzZhMDY5ZTIzZmI2ODlhNTEyMThkNzdhNWQ2M2M3Y2UxMTY=
9
+ ZDZjZTYwNWE2ZDk3MzM2OGU4OGY4NjRlYTllNzc0YTk0MDI1NDRkZDZjYWNl
10
+ ZTE4M2YxNWZkNzg0YTE0NzJkNTIwZWJmNDAwNWQ3M2I1NGZjOGQ0MmZkYWM0
11
+ ODkyMjVkMGZmM2VjM2EzNTAxYjVkZmU0MWQwNjdkMzNkOTI2YmY=
12
12
  data.tar.gz: !binary |-
13
- MjkzNGVjNTNiZTI1M2M2MTlhZDk2ZDk1MmIyNjFiNzZlZDI1NmFkNjExNjM4
14
- NTUxOGNhMTY5ZmYwNzRjZGIyNGVjODcxZGUzYTNmOWUxMDYxNWU0NzU2NTcz
15
- YTk4ZTI2NTlkMmI4M2NhZTI1M2Q3M2RjZjgzOTFlZmY0OGI2NWQ=
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
- @rspec = true
21
+ rspec = true
19
22
  end
20
23
  if i.include? "'rspec-rails'"
21
- @rspec_rails = true
24
+ rspec_rails = true
22
25
  end
23
26
  if i.include? "'simplecov'"
24
- @simplecov = true
27
+ simplecov = true
25
28
  end
26
29
  end
27
30
  }
28
31
  # add to Gemfile only for the missing gems
29
- unless @rspec and @rspec_rails and @simplecov
32
+ unless rspec and rspec_rails and simplecov
30
33
  open('Gemfile', 'a') { |f|
31
34
  f.puts 'group :development, :test do'
32
- unless @rspec
35
+ unless rspec
33
36
  f.puts " gem 'rspec'"
34
37
  end
35
- unless @rspec_rails
38
+ unless rspec_rails
36
39
  f.puts " gem 'rspec-rails'"
37
40
  end
38
- unless @simplecov
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
- @simplecov = true
83
+ simple_flag = true
79
84
  end
80
85
  end
81
- unless @simplecov
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ander
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derwin Devera, Andy Juram Lee