rails3_assist 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -31,6 +31,11 @@ module Rails3::Assist::File
31
31
  def has_gem_version? name, version = nil
32
32
  File.new(gem_file).read =~ /gem\s+('|")#{name}\1,\s*('|")#{version}\2/
33
33
  end
34
+
35
+ def clean_gemfile
36
+ clean_gemfile_content = read_gem_file.gsub(/('|")\s*gem/m, "\\1\ngem")
37
+ File.open(gem_file, 'w') {|f| f.write(clean_gemfile_content) }
38
+ end
34
39
 
35
40
  # read_application_file
36
41
  # append_to_application_file
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails3_assist}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -1,30 +1,6 @@
1
1
  source 'http://rubygems.org'
2
-
3
- gem 'rails', '3.0.0'
4
-
5
- # Bundle edge Rails instead:
6
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
-
8
- gem 'sqlite3-ruby', :require => 'sqlite3'
9
-
10
- # Use unicorn as the web server
11
- # gem 'unicorn'
12
-
13
- # Deploy with Capistrano
14
- # gem 'capistrano'
15
-
16
- # To use debugger
17
- # gem 'ruby-debug'
18
-
19
- # Bundle the extra gems:
20
- # gem 'bj'
21
- # gem 'nokogiri'
22
- # gem 'sqlite3-ruby', :require => 'sqlite3'
23
- # gem 'aws-s3', :require => 'aws/s3'
24
-
25
- # Bundle gems for the local environment. Make sure to
26
- # put test-only gems in this group so their generators
27
- # and rake tasks are available in development mode:
28
- # group :development, :test do
29
- # gem 'webrat'
30
- # end
2
+ gem 'rails', '3.0.3'
3
+ gem 'cream'
4
+ gem 'devise'
5
+ gem "mm-devise"
6
+ gem "roles_mongo_mapper"
@@ -79,9 +79,30 @@ describe Rails3::Assist::File::Special do
79
79
  end
80
80
  end
81
81
 
82
+ describe '#clean_gemfile' do
83
+ it 'should be true that it has cleaned the Gemfile ensuring newlines between each gem' do
84
+ old_gem_file_content = AppDir.new.read_gem_file
85
+
86
+ CLASS.append_to_gem_file do
87
+ "gem 'hello'gem 'hi'gem 'blip'"
88
+ end
89
+
90
+ AppDir.new.clean_gemfile
91
+
92
+ expected = "gem 'hello'\ngem 'hi'"
93
+
94
+ AppDir.new.read_gem_file.should match /#{Regexp.escape(expected)}/
95
+
96
+ File.overwrite CLASS.gem_file do
97
+ old_gem_file_content
98
+ end
99
+ end
100
+ end
101
+
82
102
  describe '#has_gem_version?' do
83
- it 'should be true that it has the rails gem 3.0.0' do
84
- AppDir.new.has_gem_version?(:rails, '3.0.0').should be_true
103
+ it 'should be true that it has the rails gem 3.0.3' do
104
+ # puts AppDir.new.read_gem_file
105
+ AppDir.new.has_gem_version?(:rails, '3.0.3').should be_true
85
106
  end
86
107
 
87
108
  it 'should be false that it has the rails gem 3.0.1' do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup