raygun 0.9.1 → 0.9.2
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 +4 -4
- data/.ruby-version +1 -1
- data/CHANGES.md +8 -2
- data/README.md +24 -4
- data/lib/raygun/raygun.rb +67 -8
- data/lib/raygun/version.rb +1 -1
- data/raygun.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f0a82b056e852ee3d58c535158fe394434c2596
|
4
|
+
data.tar.gz: 0b4b7e6de3a75834671d1a55fbd8c01e243b9391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9178655c9d0647faab7c2618152330ef89720518a66a3d01c187f3eab0530bd9cbb18311947a52fe0238f7054fc1b3d3b8dc42b757bcefd471ad8259b83bf61
|
7
|
+
data.tar.gz: bccf92b4cc0e3234dfb98785719d1b31dfc1701686ea8bb0b9af79d6067096fab3e94accec5a58bd7e64fa66fe9350be0d54c1af37f98795f28bb44b539d5741
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0-
|
1
|
+
2.0.0-p353
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.9.2 [2013-12-03]
|
4
|
+
|
5
|
+
* Support custom project templates with the -p command line arg (#122, thanks @drogar!).
|
6
|
+
* Remove the stranded and useless .raygun-version from the generated app.
|
7
|
+
* Rename the rails prototype repo to raygun-rails (#123).
|
8
|
+
|
3
9
|
## 0.9.1 [2013-11-12]
|
4
10
|
|
5
11
|
* Fixed a bug that fouled up fetching tags from github (#118).
|
@@ -7,9 +13,9 @@
|
|
7
13
|
|
8
14
|
## 0.9.0 [2013-11-11]
|
9
15
|
|
10
|
-
Note: All future changes to the application prototype (sample app) will be made in the [raygun-
|
16
|
+
Note: All future changes to the application prototype (sample app) will be made in the [raygun-rails](https://github.com/carbonfive/raygun-rails) repo.
|
11
17
|
|
12
|
-
* Raygun no longer bundles the application prototype, it's fetched from github (https://github.com/carbonfive/raygun-
|
18
|
+
* Raygun no longer bundles the application prototype, it's fetched from github (https://github.com/carbonfive/raygun-rails) instead (#112).
|
13
19
|
* Drop support for Rails 3 (#116).
|
14
20
|
* Better bootstrap 3 support (#115, thanks @felafelwaffle!).
|
15
21
|
|
data/README.md
CHANGED
@@ -6,9 +6,12 @@
|
|
6
6
|
Rails application generator that builds a new project skeleton configured with Carbon Five preferences and
|
7
7
|
best practices baked right in. Spend less time configuring and more building cool features.
|
8
8
|
|
9
|
-
Raygun generates Rails 4 projects by copying this [sample app](https://github.com/carbonfive/raygun-
|
9
|
+
Raygun generates Rails 4 projects by copying this [sample app](https://github.com/carbonfive/raygun-rails)
|
10
10
|
and massaging it gently into shape.
|
11
11
|
|
12
|
+
Alternatively, Raygun allows you to specify your own prototype instead of the default sample app. See below
|
13
|
+
for details.
|
14
|
+
|
12
15
|
Major tools/libraries:
|
13
16
|
|
14
17
|
* Rails 4.0
|
@@ -21,7 +24,7 @@ Major tools/libraries:
|
|
21
24
|
* Jasmine
|
22
25
|
* SimpleCov
|
23
26
|
* Guard (rspec, jasmine, livereload)
|
24
|
-
* And many tweaks, patterns and common recipes (see [raygun-
|
27
|
+
* And many tweaks, patterns and common recipes (see [raygun-rails](https://github.com/carbonfive/raygun-rails) for all the details).
|
25
28
|
|
26
29
|
Raygun includes generator templates for controllers, views, and specs so that generated code follows best
|
27
30
|
practices. For example, view generation produces bootstrap compatible markup and rspec specs use factory
|
@@ -44,7 +47,7 @@ Raygun...
|
|
44
47
|
|
45
48
|
## Prerequisites
|
46
49
|
|
47
|
-
To generate an application, you
|
50
|
+
To generate an application, you need the raygun gem and wget (```brew install wget```).
|
48
51
|
|
49
52
|
To run your new application's specs or fire up its server, you'll need to meet these requirements.
|
50
53
|
|
@@ -75,9 +78,26 @@ covered (see above).
|
|
75
78
|
$ foreman start
|
76
79
|
$ open http://localhost:3000
|
77
80
|
|
81
|
+
## Using a Custom Project Template
|
82
|
+
|
83
|
+
The default is to use the project at [carbonfive/raygun-rails](https://github.com/carbonfive/raygun-rails) as a
|
84
|
+
starting point. You can use another repo as the project template with the ```-p``` command line option.
|
85
|
+
|
86
|
+
If you invoke raygun with the ```-p``` option, you can specify your own github repository.
|
87
|
+
|
88
|
+
$ raygun -p githubid/repo your-project
|
89
|
+
|
90
|
+
The repository must:
|
91
|
+
|
92
|
+
* Have been tagged. Raygun chooses the "greatest" tag and downloads the repository as of that tag.
|
93
|
+
* Not have any binary files. Raygun runs a 'sed' command on all files, which will fail on binaries, such as jar files.
|
94
|
+
|
95
|
+
If your project template requires a minimum version of raygun, include the version in a file called
|
96
|
+
```.raygun-version``` at the root. Raygun will make sure it's new enough for your repo.
|
97
|
+
|
78
98
|
## Internal Mechanics
|
79
99
|
|
80
|
-
Raygun fetches the
|
100
|
+
Raygun fetches the greatest tag from the [carbonfive/raygun-rails](https://github.com/carbonfive/raygun-rails)
|
81
101
|
repo, unless it already has it cached in ~/.raygun, extracts the contents of the tarball, and runs a series of
|
82
102
|
search-and-replaces on the code to customize it accordingly.
|
83
103
|
|
data/lib/raygun/raygun.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative 'version'
|
|
10
10
|
|
11
11
|
module Raygun
|
12
12
|
class Runner
|
13
|
+
CARBONFIVE_REPO = 'carbonfive/raygun-rails'
|
13
14
|
attr_accessor :target_dir, :app_dir, :app_name, :dash_name, :snake_name, :camel_name, :title_name, :prototype_repo
|
14
15
|
|
15
16
|
def initialize(target_dir, prototype_repo)
|
@@ -87,6 +88,7 @@ module Raygun
|
|
87
88
|
|
88
89
|
shell "tar xfz #{@prototype} -C #{app_dir}"
|
89
90
|
|
91
|
+
# Github includes an extra directory layer in the tag tarball.
|
90
92
|
extraneous_dir = Dir.glob("#{app_dir}/*").first
|
91
93
|
dirs_to_move = Dir.glob("#{extraneous_dir}/*", File::FNM_DOTMATCH)
|
92
94
|
.reject { |d| %w{. ..}.include?(File.basename(d)) }
|
@@ -109,10 +111,17 @@ module Raygun
|
|
109
111
|
end
|
110
112
|
|
111
113
|
def configure_new_app
|
114
|
+
clean_up_unwanted_files
|
115
|
+
|
112
116
|
update_ruby_version
|
117
|
+
|
113
118
|
initialize_git
|
114
119
|
end
|
115
120
|
|
121
|
+
def clean_up_unwanted_files
|
122
|
+
FileUtils.rm "#{app_dir}/.raygun-version", force: true
|
123
|
+
end
|
124
|
+
|
116
125
|
def update_ruby_version
|
117
126
|
prototype_ruby_patch_level = File.read(File.expand_path("#{app_dir}/.ruby-version", __FILE__)).strip
|
118
127
|
prototype_ruby_version = prototype_ruby_patch_level.match(/(\d\.\d\.\d).*/)[1]
|
@@ -150,6 +159,14 @@ module Raygun
|
|
150
159
|
end
|
151
160
|
|
152
161
|
def print_next_steps
|
162
|
+
if @prototype_repo == CARBONFIVE_REPO
|
163
|
+
print_next_steps_carbon_five
|
164
|
+
else
|
165
|
+
print_next_steps_for_custom_repo
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def print_next_steps_carbon_five
|
153
170
|
puts ""
|
154
171
|
puts "Zap! Your application is ready. Next steps...".colorize(:yellow)
|
155
172
|
puts ""
|
@@ -170,17 +187,59 @@ module Raygun
|
|
170
187
|
puts ""
|
171
188
|
puts "Enjoy your Carbon Five flavored Rails application!".colorize(:yellow)
|
172
189
|
end
|
190
|
+
|
191
|
+
def print_next_steps_for_custom_repo
|
192
|
+
puts ""
|
193
|
+
puts "Zap! Your application is ready.".colorize(:yellow)
|
194
|
+
puts ""
|
195
|
+
puts "Enjoy your raygun generated application!".colorize(:yellow)
|
196
|
+
end
|
173
197
|
|
174
198
|
protected
|
175
199
|
|
176
|
-
# Fetch the tags for the repo (e.g. 'carbonfive/raygun-
|
200
|
+
# Fetch the tags for the repo (e.g. 'carbonfive/raygun-rails') and return the latest as JSON.
|
177
201
|
def fetch_latest_tag(repo)
|
178
|
-
url = "https://api.github.com/repos/#{
|
202
|
+
url = "https://api.github.com/repos/#{repo}/tags"
|
179
203
|
uri = URI.parse(url)
|
180
204
|
http = Net::HTTP.new(uri.host, uri.port)
|
181
205
|
http.use_ssl = true
|
182
206
|
request = Net::HTTP::Get.new(URI.encode(url))
|
183
|
-
|
207
|
+
|
208
|
+
response = http.request(request)
|
209
|
+
|
210
|
+
unless response.code == "200"
|
211
|
+
puts ""
|
212
|
+
print "Whoops - need to try again!".colorize(:red)
|
213
|
+
puts ""
|
214
|
+
print "We could not find (".colorize(:light_red)
|
215
|
+
print "#{repo}".colorize(:white)
|
216
|
+
print ") on github.".colorize(:light_red)
|
217
|
+
puts ""
|
218
|
+
print "The response from github was a (".colorize(:light_red)
|
219
|
+
print "#{response.code}".colorize(:white)
|
220
|
+
puts ") which I'm sure you can fix right up!".colorize(:light_red)
|
221
|
+
puts ""
|
222
|
+
exit 1
|
223
|
+
end
|
224
|
+
|
225
|
+
result = JSON.parse(response.body).first
|
226
|
+
unless result
|
227
|
+
puts ""
|
228
|
+
print "Whoops - need to try again!".colorize(:red)
|
229
|
+
puts ""
|
230
|
+
print "We could not find any tags in the repo (".colorize(:light_red)
|
231
|
+
print "#{repo}".colorize(:white)
|
232
|
+
print ") on github.".colorize(:light_red)
|
233
|
+
puts ""
|
234
|
+
print "Raygun uses the 'largest' tag in a repository, where tags are sorted alphanumerically.".colorize(:light_red)
|
235
|
+
puts ""
|
236
|
+
print "E.g., tag 'v.0.10.0' > 'v.0.9.9' and 'x' > 'a'.".colorize(:light_red)
|
237
|
+
print ""
|
238
|
+
puts ""
|
239
|
+
exit 1
|
240
|
+
end
|
241
|
+
|
242
|
+
result
|
184
243
|
end
|
185
244
|
|
186
245
|
def camelize(string)
|
@@ -212,17 +271,17 @@ module Raygun
|
|
212
271
|
|
213
272
|
options = OpenStruct.new
|
214
273
|
options.target_dir = nil
|
215
|
-
options.prototype_repo =
|
274
|
+
options.prototype_repo = CARBONFIVE_REPO
|
216
275
|
|
217
276
|
parser = OptionParser.new do |opts|
|
218
277
|
opts.banner = "Usage: raygun [options] NEW_APP_DIRECTORY"
|
219
278
|
|
220
|
-
opts.on('-h', '--help', "Show raygun usage") do
|
279
|
+
opts.on('-h', '--help', "Show raygun usage") do
|
221
280
|
usage_and_exit(opts)
|
222
281
|
end
|
223
|
-
|
224
|
-
|
225
|
-
|
282
|
+
opts.on('-p', '--prototype [github_repo]', "Prototype github repo (e.g. carbonfive/raygun-rails).") do |prototype|
|
283
|
+
options.prototype_repo = prototype
|
284
|
+
end
|
226
285
|
end
|
227
286
|
|
228
287
|
begin
|
data/lib/raygun/version.rb
CHANGED
data/raygun.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.description = %q{Carbon Five Rails application generator}
|
15
15
|
gem.summary = %q{Generates and customizes Rails applications with Carbon Five best practices baked in.}
|
16
16
|
gem.homepage = "https://github.com/carbonfive/raygun"
|
17
|
-
gem
|
17
|
+
gem.license = 'MIT'
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($/)
|
20
20
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raygun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Nelson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Carbon Five Rails application generator
|
16
16
|
email:
|
@@ -35,7 +35,8 @@ files:
|
|
35
35
|
- marvin.jpg
|
36
36
|
- raygun.gemspec
|
37
37
|
homepage: https://github.com/carbonfive/raygun
|
38
|
-
licenses:
|
38
|
+
licenses:
|
39
|
+
- MIT
|
39
40
|
metadata: {}
|
40
41
|
post_install_message:
|
41
42
|
rdoc_options: []
|
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
version: '0'
|
54
55
|
requirements: []
|
55
56
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.1.11
|
57
58
|
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: Generates and customizes Rails applications with Carbon Five best practices
|