radiant-go 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,7 +1,12 @@
1
1
  == Change Log
2
2
 
3
+ === 0.1.5 (August 24, 2010)
3
4
 
4
- === 0.1.3 (August 23, 2010)
5
+ * Altered the version grabbing of gems to be more thorough and precise [Mario Visic]
6
+ * Fixed a bug causing the environment to require the same gem multiple times [Mario Visic]
7
+ * Altered the gemfile to use strict versioning [Dirk Kelly]
8
+
9
+ === 0.1.4 (August 23, 2010)
5
10
 
6
11
  * Fixed a bug with running bootstrap multiple times on the same project [Mario Visic]
7
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.6
@@ -1,12 +1,16 @@
1
- source 'http://rubygems.org'
1
+ source :gemcutter
2
2
 
3
3
  gem 'rails', '2.3.8'
4
- gem 'sqlite3-ruby', :require => 'sqlite3'
5
- gem 'haml', '>= 3.0.0'
6
- gem 'compass', '>= 0.10.4'
7
- gem 'compass-960-plugin', '>= 0.9.13'
8
- gem 'rmagick', '>= 2.13.1'
9
- gem 'aws-s3', '>= 0.6.2', :require => 'aws/s3'
10
- gem 'paperclip', '>= 2.3.3'
11
- gem 'radiant-forms-extension', '>= 2.0.1'
12
- gem 'radiant-settings-extension', '>= 1.1.1'
4
+ gem 'json_pure', '1.4.6'
5
+ gem 'RedCloth', '4.2.3'
6
+ gem 'radiant', '0.9.1'
7
+ gem 'acts_as_list', '0.1.2'
8
+ gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'
9
+ gem 'haml', '3.0.17'
10
+ gem 'compass', '0.10.4'
11
+ gem 'compass-960-plugin', '0.9.13'
12
+ gem 'rmagick', '2.13.1'
13
+ gem 'aws-s3', '0.6.2', :require => 'aws/s3'
14
+ gem 'paperclip', '2.3.3'
15
+ gem 'radiant-forms-extension', '2.0.1'
16
+ gem 'radiant-settings-extension', '1.1.1'
@@ -14,7 +14,7 @@ module RadiantGo
14
14
 
15
15
  # setup default gemfile location
16
16
  if File.exists?(@project_name + '/Gemfile')
17
- Config.gemfile_location = @project_name + '/Gemfile'
17
+ Config.gemfile_location = File.expand_path(@project_name) + '/Gemfile'
18
18
  else
19
19
  Config.gemfile_location = File.expand_path(File.dirname(__FILE__)) + '/../../../config/Gemfile'
20
20
  end
@@ -27,19 +27,33 @@ module RadiantGo
27
27
  Dir.chdir(@name) do
28
28
 
29
29
  # open our config
30
- config_file = File.open('config/environment.rb', 'r')
31
- config_string = ''
30
+ config_file = File.open 'config/environment.rb'
31
+ current_gems = []
32
+
33
+ # get a list of the gems in the config
34
+ while (line = config_file.gets)
35
+ if gem = line.match(/config.gem\s*['"](.*?)['"]/)
36
+ current_gems << gem[1]
37
+ end
38
+ end
39
+
40
+ # go back to the beginning of our environment file and blank out our strings
41
+ config_file.rewind
32
42
  line = ''
43
+ config_string = ''
33
44
 
34
45
  # read up to the part where we are loading gems
35
46
  while(line.index('config.gem') == nil)
36
47
  line = config_file.gets
37
48
  config_string += line
38
49
  end
39
-
50
+
40
51
  # loop through all our radiant extensions and add the lines we need for config
41
52
  all_extensions.each do |gem|
42
- config_string += " config.gem '#{gem[:name]}', :version => '#{gem[:requirement]}', :lib => false\n"
53
+ # we only add the gem to our config if it's not already there!
54
+ if !current_gems.any? {|current_gem| current_gem == gem[:name]}
55
+ config_string += " config.gem '#{gem[:name]}', :version => '#{gem[:requirement]}', :lib => false\n"
56
+ end
43
57
  end
44
58
 
45
59
  # read the rest of the config
@@ -86,7 +100,7 @@ module RadiantGo
86
100
  gemfile = File.open(Config.gemfile_location, 'r')
87
101
 
88
102
  while(line = gemfile.gets)
89
- if extension = line.match(/gem.*(radiant-.*-extension).*['"](.*)['"]/)
103
+ if extension = line.match(/gem.*(radiant-.*-extension).*['"]\s*((=|>=|>|<|<=|~>)?\s*[\d.rc]*)\s*['"]/)
90
104
  extensions.push(:name => extension[1], :requirement => extension[2])
91
105
  end
92
106
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-go}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["squaretalent"]
12
- s.date = %q{2010-08-23}
12
+ s.date = %q{2010-08-24}
13
13
  s.default_executable = %q{radiant-go}
14
14
  s.description = %q{a quick an easy way to create radiant projects that are ready to use straight away, automatically perform bootstraps, migrations and updates for radiant and extensions, radiant-go is completely customizable little orphan awesome}
15
15
  s.email = %q{mario@mariovisic.com}
@@ -90,6 +90,26 @@ module RadiantGo
90
90
  File.size('test/db/development.' + Config.database + '.db').should be > size
91
91
 
92
92
  end
93
+
94
+ it 'should not create mutiple config.gem lines in the environment file when run more than once' do
95
+
96
+ @installer.update_config
97
+ @installer.update_config
98
+
99
+ required_gems = []
100
+ environment = File.open 'test/config/environment.rb'
101
+
102
+ # get a list of the gems in the config
103
+ while (line = environment.gets)
104
+ if gem = line.match(/config.gem\s*['"](.*?)['"]/)
105
+ required_gems << gem[1]
106
+ end
107
+ end
108
+
109
+ # and check for duplicates
110
+ required_gems.eql?(required_gems.uniq).should be true
111
+
112
+ end
93
113
 
94
114
  end
95
115
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-go
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - squaretalent
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-23 00:00:00 +08:00
18
+ date: 2010-08-24 00:00:00 +08:00
19
19
  default_executable: radiant-go
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency