ander 1.0.7 → 1.0.8
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 +25 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjMxZDk3YWJhMTNlMTkzYjI3M2RjZWJjYzkzMzhiM2JmYmI4YjM5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDVhYTk2OWRhOWM4M2EzMmZlMmQ0OWRmNmQ5OGIyOTU3OTU5ZGVlYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmU4NTkyYWJiNDk1NWM0YzM2MmNkYjFkMmQwMDQyZmEwNDBiYmI0MzlmNDVl
|
10
|
+
OTg2NTNhOWNlN2NhNDQwOWEzNmNlZTcwMTY1MGIzNmE4ODI4YzhiMGE4M2Ni
|
11
|
+
N2NhY2UxNjM5NzM5YmEwOTcwYjM3NjU0ZmQ2NWQzMDI0MjlhYmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmI0M2ExYWU3ODNhYjkwNzJhMDcwYWY5NTQ5Mzc5YWJlNGMzYWMwYzk1YjIx
|
14
|
+
MjE4MTZiZGMzNTJjZTYyMjJhNmNiNGM3MmZkNGY3MzZkMDNlNmY2ZTI2ZDBj
|
15
|
+
NzY4MGJiMzgxNzJkYjY0M2VlZTk4MDExOWUwNjUxMGUxZTM3YWU=
|
data/lib/ander.rb
CHANGED
@@ -9,7 +9,7 @@ class Ander
|
|
9
9
|
|
10
10
|
def self.add_to_gemfile
|
11
11
|
# Include rspec, rails_spec and simplecov in Gemfile
|
12
|
-
puts "\
|
12
|
+
puts "\n--Adding rspec, rspec-rails and simplecov to the Gemfile"
|
13
13
|
# Check if any gems already exists in Gemfile
|
14
14
|
rspec = false
|
15
15
|
rspec_rails = false
|
@@ -33,12 +33,15 @@ class Ander
|
|
33
33
|
open('Gemfile', 'a') { |f|
|
34
34
|
f.puts 'group :development, :test do'
|
35
35
|
unless rspec
|
36
|
+
puts '-Added rspec to Gemfile'
|
36
37
|
f.puts " gem 'rspec'"
|
37
38
|
end
|
38
39
|
unless rspec_rails
|
40
|
+
puts '-Added rspec-rails to Gemfile'
|
39
41
|
f.puts " gem 'rspec-rails'"
|
40
42
|
end
|
41
43
|
unless simplecov
|
44
|
+
puts 'Added simplecov to Gemfile'
|
42
45
|
f.puts " gem 'simplecov'"
|
43
46
|
end
|
44
47
|
f.puts 'end'
|
@@ -49,21 +52,23 @@ class Ander
|
|
49
52
|
|
50
53
|
def self.bundle_install
|
51
54
|
# Bundle install
|
52
|
-
puts "\
|
55
|
+
puts "\n--Executing Bundle Install"
|
53
56
|
system('bundle install')
|
54
57
|
end
|
55
58
|
|
56
59
|
def self.run_setup_commands
|
57
60
|
# run all required setup commands for rspec
|
58
|
-
puts "\
|
61
|
+
puts "\n--Running setup commands for rspec"
|
59
62
|
system('spring stop')
|
63
|
+
puts '-Executing rails generate rspec:install'
|
60
64
|
system('rails generate rspec:install')
|
61
65
|
system('spring stop')
|
62
66
|
end
|
63
67
|
|
64
68
|
def self.configure_dotrspec
|
65
69
|
# configure .rspec
|
66
|
-
puts "\
|
70
|
+
puts "\n--configuring rspec output format in .rspec"
|
71
|
+
puts '-setting output format to progress and html'
|
67
72
|
open('.rspec', 'w') { |f|
|
68
73
|
f.puts '--color'
|
69
74
|
f.puts '--require spec_helper'
|
@@ -74,22 +79,35 @@ class Ander
|
|
74
79
|
end
|
75
80
|
|
76
81
|
def self.modify_spec_helper
|
77
|
-
puts "Adding require 'simplecov' and SimpleCov.Start"
|
82
|
+
puts "--Adding require 'simplecov' and SimpleCov.Start"
|
78
83
|
open('spec/spec_helper.rb', 'r'){ |f|
|
79
84
|
simple_flag = false
|
85
|
+
rspec_rails = false
|
80
86
|
@contents = f.readlines
|
81
87
|
@contents.each do |i|
|
82
88
|
if i.include? "require 'simplecov'"
|
83
89
|
simple_flag = true
|
84
90
|
end
|
91
|
+
if i.include? "require 'rspec/rails'"
|
92
|
+
rspec_rails = true
|
93
|
+
end
|
85
94
|
end
|
86
95
|
unless simple_flag
|
96
|
+
puts "-Adding require 'simplecov' to spec_helper.rb"
|
87
97
|
@contents.each_with_index {|i, index|
|
88
98
|
if i.include? "RSpec.configure do |config|\n"
|
89
99
|
@contents[index] =
|
90
100
|
i + " require 'simplecov'\n"\
|
91
|
-
" SimpleCov.start\n"
|
92
|
-
|
101
|
+
" SimpleCov.start\n"
|
102
|
+
end
|
103
|
+
}
|
104
|
+
end
|
105
|
+
unless rspec_rails
|
106
|
+
puts "-Adding rails environment setting and require 'rspec/rails' to spec_helper.rb"
|
107
|
+
@contents.each_with_index {|i, index|
|
108
|
+
if i.include? "RSpec.configure do |config|\n"
|
109
|
+
@contents[index] =
|
110
|
+
i + " ENV['RAILS_ENV'] = 'test'\n"\
|
93
111
|
" require File.expand_path('../../config/environment', __FILE__)\n"\
|
94
112
|
" require 'rspec/rails'\n"
|
95
113
|
end
|