sparkler 0.0.1
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.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +11 -0
- data/bin/sparkler +11 -0
- data/lib/sparkler/app_builder.rb +16 -0
- data/lib/sparkler/generators/app_generator.rb +42 -0
- data/lib/sparkler/version.rb +3 -0
- data/lib/sparkler.rb +5 -0
- data/sparkler.gemspec +21 -0
- data/test/lib/sparkler/version_test.rb +7 -0
- data/test/test_helper.rb +3 -0
- metadata +83 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Chris Moore
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Sparkler
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'sparkler'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install sparkler
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/sparkler
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(File.join('..', 'lib', 'sparkler', 'generators', 'app_generator'), File.dirname(__FILE__))
|
4
|
+
require File.expand_path(File.join('..', 'lib', 'sparkler', 'app_builder'), File.dirname(__FILE__))
|
5
|
+
|
6
|
+
templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
|
7
|
+
Sparkler::AppGenerator.source_root templates_root
|
8
|
+
Sparkler::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
|
9
|
+
|
10
|
+
Sparkler::AppGenerator.start
|
11
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Sparkler
|
2
|
+
class AppBuilder < Rails::AppBuilder
|
3
|
+
|
4
|
+
def remove_public_index
|
5
|
+
remove_file 'public/index.html'
|
6
|
+
end
|
7
|
+
|
8
|
+
def remove_rails_logo_image
|
9
|
+
remove_file 'app/assets/images/rails.png'
|
10
|
+
end
|
11
|
+
|
12
|
+
def setup_staging_environment
|
13
|
+
run 'cp config/environments/production.rb config/environments/staging.rb'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/rails/app/app_generator'
|
3
|
+
|
4
|
+
module Sparkler
|
5
|
+
class AppGenerator < Rails::Generators::AppGenerator
|
6
|
+
|
7
|
+
def finish_template
|
8
|
+
invoke :sparkler_customization
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def sparkler_customization
|
13
|
+
invoke :remove_useless_files
|
14
|
+
end
|
15
|
+
|
16
|
+
def remove_useless_files
|
17
|
+
build :remove_public_index
|
18
|
+
build :remove_rails_logo_image
|
19
|
+
end
|
20
|
+
|
21
|
+
def setup_staging_environment
|
22
|
+
say 'Setting up the staging environment'
|
23
|
+
build :setup_staging_environment
|
24
|
+
build :initialize_on_precompile
|
25
|
+
end
|
26
|
+
|
27
|
+
def run_bundle
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
protected
|
32
|
+
|
33
|
+
def get_builder_class
|
34
|
+
Sparkler::AppBuilder
|
35
|
+
end
|
36
|
+
|
37
|
+
def using_active_record?
|
38
|
+
!options[:skip_active_record]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
data/lib/sparkler.rb
ADDED
data/sparkler.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/sparkler/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "sparkler"
|
6
|
+
gem.version = Sparkler::VERSION
|
7
|
+
gem.date = Date.today.strftime('%Y-%m-%d')
|
8
|
+
gem.authors = ["Chris Moore"]
|
9
|
+
gem.email = ["chrism@gaslightsoftware.com"]
|
10
|
+
gem.summary = %q{Generate a Rails app using Gaslight's choices of gems and frameworks.}
|
11
|
+
gem.description = %q{}
|
12
|
+
gem.homepage = "https://github.com/gaslight/sparkler"
|
13
|
+
|
14
|
+
gem.files = `git ls-files`.split($\)
|
15
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
|
19
|
+
gem.add_dependency 'rails', '3.2.8'
|
20
|
+
gem.add_dependency 'bundler', '>= 1.1'
|
21
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sparkler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Moore
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &70293825788640 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - =
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.8
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70293825788640
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &70293825786380 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.1'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70293825786380
|
36
|
+
description: ''
|
37
|
+
email:
|
38
|
+
- chrism@gaslightsoftware.com
|
39
|
+
executables:
|
40
|
+
- sparkler
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- .gitignore
|
45
|
+
- Gemfile
|
46
|
+
- LICENSE
|
47
|
+
- README.md
|
48
|
+
- Rakefile
|
49
|
+
- bin/sparkler
|
50
|
+
- lib/sparkler.rb
|
51
|
+
- lib/sparkler/app_builder.rb
|
52
|
+
- lib/sparkler/generators/app_generator.rb
|
53
|
+
- lib/sparkler/version.rb
|
54
|
+
- sparkler.gemspec
|
55
|
+
- test/lib/sparkler/version_test.rb
|
56
|
+
- test/test_helper.rb
|
57
|
+
homepage: https://github.com/gaslight/sparkler
|
58
|
+
licenses: []
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.8.11
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: Generate a Rails app using Gaslight's choices of gems and frameworks.
|
81
|
+
test_files:
|
82
|
+
- test/lib/sparkler/version_test.rb
|
83
|
+
- test/test_helper.rb
|