rails_setup 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,6 +49,9 @@ module RailsSetup
49
49
  return_value
50
50
  end
51
51
 
52
+ # Creates a file based on a '.example' version saved in the same folder
53
+ # Will optionally open the new file in the default editor after creation
54
+ #
52
55
  def create_file(file, name, requires_edit=false)
53
56
  FileUtils.cp(file + '.example', file)
54
57
 
@@ -58,5 +61,15 @@ module RailsSetup
58
61
  exit
59
62
  end
60
63
  end
64
+
65
+ # Looks for the specificed file and creates it if it does not exist
66
+ #
67
+ def find_or_create_file(file, name, requires_edit=false)
68
+ if File.exists?(file)
69
+ file
70
+ else
71
+ create_file(file, name, requires_edit)
72
+ end
73
+ end
61
74
  end
62
75
  end
@@ -1,3 +1,3 @@
1
1
  module RailsSetup
2
- VERSION = "0.0.1" unless defined?(::RailsSetup::VERSION)
2
+ VERSION = "0.0.2" unless defined?(::RailsSetup::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
16
- requirement: &2181208140 !ruby/object:Gem::Requirement
16
+ requirement: &2170003320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2181208140
24
+ version_requirements: *2170003320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline
27
- requirement: &2181207720 !ruby/object:Gem::Requirement
27
+ requirement: &2170002900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2181207720
35
+ version_requirements: *2170002900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &2181207220 !ruby/object:Gem::Requirement
38
+ requirement: &2170002400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.0.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2181207220
46
+ version_requirements: *2170002400
47
47
  description: Helper methods for better rake setup tasks
48
48
  email:
49
49
  - jordan.byron@gmail.com
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  segments:
106
106
  - 0
107
- hash: -2835416238459538838
107
+ hash: -2879396514878447790
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  none: false
110
110
  requirements:
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  segments:
115
115
  - 0
116
- hash: -2835416238459538838
116
+ hash: -2879396514878447790
117
117
  requirements: []
118
118
  rubyforge_project:
119
119
  rubygems_version: 1.8.15