gem_suit 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +10 -0
  2. data/.suit +4 -0
  3. data/CHANGELOG.rdoc +5 -0
  4. data/Gemfile +3 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.textile +419 -0
  7. data/Rakefile +26 -0
  8. data/VERSION +1 -0
  9. data/bin/suit +10 -0
  10. data/gem_suit.gemspec +26 -0
  11. data/lib/gem_suit/application/actions.rb +203 -0
  12. data/lib/gem_suit/application/test.rb +106 -0
  13. data/lib/gem_suit/application/utils/gemfile.rb +42 -0
  14. data/lib/gem_suit/application/utils.rb +135 -0
  15. data/lib/gem_suit/application.rb +42 -0
  16. data/lib/gem_suit/cli/application/io_buffer.rb +54 -0
  17. data/lib/gem_suit/cli/application/test_loader.rb +5 -0
  18. data/lib/gem_suit/cli/application.rb +159 -0
  19. data/lib/gem_suit/cli/base/shell.rb +41 -0
  20. data/lib/gem_suit/cli/base/utils.rb +83 -0
  21. data/lib/gem_suit/cli/base.rb +15 -0
  22. data/lib/gem_suit/cli/builder/boot +14 -0
  23. data/lib/gem_suit/cli/builder/generator.rb +154 -0
  24. data/lib/gem_suit/cli/builder/rails_app.rb +146 -0
  25. data/lib/gem_suit/cli/builder.rb +143 -0
  26. data/lib/gem_suit/cli/config/hash.rb +61 -0
  27. data/lib/gem_suit/cli/config.rb +37 -0
  28. data/lib/gem_suit/cli.rb +145 -0
  29. data/lib/gem_suit/integration_test.rb +14 -0
  30. data/lib/gem_suit/test_help.rb +17 -0
  31. data/lib/gem_suit/version.rb +9 -0
  32. data/lib/gem_suit.rb +6 -0
  33. data/templates/dynamic/CHANGELOG.rdoc +5 -0
  34. data/templates/dynamic/Gemfile +14 -0
  35. data/templates/dynamic/MIT-LICENSE +20 -0
  36. data/templates/dynamic/README.textile +35 -0
  37. data/templates/dynamic/VERSION +1 -0
  38. data/templates/dynamic/config/boot.rb +13 -0
  39. data/templates/dynamic/config/preinitializer.rb +20 -0
  40. data/templates/dynamic/gitignore +9 -0
  41. data/templates/dynamic/suit/shared/app/views/application/index.html.erb +16 -0
  42. data/templates/dynamic/suit/shared/public/stylesheets/app.css +99 -0
  43. data/templates/dynamic/suit/shared/test/test_helper.rb +37 -0
  44. data/templates/dynamic/suit/templates/shared/Gemfile +14 -0
  45. data/templates/dynamic/suit/templates/shared/config/database-mysql.yml +11 -0
  46. data/templates/dynamic/suit/templates/shared/config/database-sqlite.yml +10 -0
  47. data/templates/static/suit/shared/app/models/.gitkeep +0 -0
  48. data/templates/static/suit/shared/app/views/layouts/application.html.erb +11 -0
  49. data/templates/static/suit/shared/db/schema.rb +2 -0
  50. data/templates/static/suit/shared/db/seeds.rb +7 -0
  51. data/templates/static/suit/shared/test/fixtures/.gitkeep +0 -0
  52. data/templates/static/suit/shared/test/integration/suit/example.rb +40 -0
  53. data/templates/static/suit/shared/test/suit_application/capybara_extensions.rb +36 -0
  54. data/templates/static/suit/shared/test/suit_application.rb +27 -0
  55. data/templates/static/suit/shared/test/unit/.gitkeep +0 -0
  56. data/templates/static/suit/templates/shared/config/initializers/.gitkeep +0 -0
  57. data/templates/static/suit/templates/shared/db/schema.rb +2 -0
  58. metadata +188 -0
@@ -0,0 +1,143 @@
1
+ require "fileutils"
2
+ require "gem_suit/cli/builder/rails_app"
3
+ require "gem_suit/cli/builder/generator"
4
+
5
+ module GemSuit
6
+ class CLI < Thor
7
+ module Builder
8
+
9
+ def self.included(base)
10
+ base.send :include, InstanceMethods
11
+ end
12
+
13
+ module InstanceMethods
14
+ private
15
+
16
+ TEST_SUITS = "{test}"
17
+ TEMP_DIR = "tmp"
18
+
19
+ # `suit up`
20
+
21
+ def create_shared_assets
22
+ stash_test_suites
23
+ FileUtils.cp_r File.join(static_templates_path, "."), "."
24
+ move_test_suits
25
+ end
26
+
27
+ def stash_test_suites
28
+ return if Dir[TEST_SUITS].empty?
29
+ FileUtils.mkdir TEMP_DIR unless File.exists? TEMP_DIR
30
+
31
+ Dir[TEST_SUITS].each do |dir|
32
+ FileUtils.mv dir, TEMP_DIR
33
+ end
34
+ end
35
+
36
+ def move_test_suits
37
+ Dir["#{TEMP_DIR}/#{TEST_SUITS}"].each do |dir|
38
+ if File.basename(dir) == "test"
39
+ Dir["#{dir}/*"].each do |entry|
40
+ destination = File.expand_path "suit/shared/test"
41
+ if %w(fixtures integration unit).include? File.basename(entry)
42
+ FileUtils.rm_rf File.expand_path(File.basename(entry), destination)
43
+ end
44
+ FileUtils.mv entry, destination
45
+ end
46
+ FileUtils.rmdir dir
47
+ else
48
+ destination = File.expand_path "suit/shared/#{File.basename(dir)}"
49
+ FileUtils.rm destination if File.exists? destination
50
+ FileUtils.mv dir, destination
51
+ end
52
+ end
53
+
54
+ Dir["#{TEMP_DIR}/**/.DS_Store"].each do |file|
55
+ FileUtils.rm file
56
+ end
57
+
58
+ FileUtils.rmdir TEMP_DIR if File.exists? TEMP_DIR
59
+ end
60
+
61
+ def create_rails_apps
62
+ suit_config_global[:rails_versions].each do |version|
63
+ Builder::RailsApp.new(version, self).install
64
+ end
65
+ end
66
+
67
+ def generate_files
68
+ Builder::Generator.new(self).run
69
+ end
70
+
71
+ # `suit fit`
72
+
73
+ def bundle_install
74
+ return if `bundle check`.none?{|line| line.include? "`bundle install`"}
75
+ puts "Running `bundle install` (this can take several minutes...)".yellow
76
+ puts "(in #{File.expand_path("")})"
77
+ `bundle install`
78
+ end
79
+
80
+ def bundle_install_apps
81
+ Dir["suit/rails-*/dummy"].each do |rails_root|
82
+ Object.send :remove_const, :SuitApplication
83
+ require File.expand_path("test/suit_application.rb", rails_root)
84
+ SuitApplication.bundle_install
85
+ end
86
+ end
87
+
88
+ def rake_install
89
+ return if Dir["rails_generators"].empty?
90
+ cmd = "rake install"
91
+ log "Running 'rake install' in order to be able to run the Rails 2 generators".green
92
+ log cmd
93
+ `#{cmd}`
94
+ end
95
+
96
+ def ask_mysql_password
97
+ return unless suit_config.mysql?
98
+
99
+ log "Setting up the MySQL test database".green
100
+ log "To be able to run integration tests (with Capybara in Firefox) we need to store your MySQL password in a git-ignored file (suit/shared/mysql)"
101
+ log "Please provide the password of your MySQL root user: (press Enter when blank)", true
102
+
103
+ begin
104
+ system "stty -echo"
105
+ password = STDIN.gets.strip
106
+ ensure
107
+ system "stty echo"
108
+ end
109
+
110
+ file = "suit/shared/mysql"
111
+ if password.length == 0
112
+ File.delete file if File.exists? file
113
+ else
114
+ File.open(file, "w"){|f| f << password}
115
+ log "\n"
116
+ end
117
+ end
118
+
119
+ def create_mysql_test_database
120
+ return unless suit_config.mysql?
121
+
122
+ rails_root = Dir["suit/rails-*/dummy"].max
123
+ log "Creating the test database".green
124
+ log "cd #{rails_root} && RAILS_ENV=test rake db:create"
125
+
126
+ require File.expand_path("test/suit_application.rb", rails_root)
127
+ SuitApplication.create_test_database
128
+ end
129
+
130
+ def create_development_databases
131
+ Dir["suit/rails-*/dummy"].each do |rails_root|
132
+ cmd = "cd #{rails_root} && rake db:setup"
133
+ version = rails_root.match(/suit\/([^\/]*)\//).captures[0].capitalize.gsub "-", " "
134
+ log "Creating Rails #{version} development database".green
135
+ log cmd
136
+ execute cmd
137
+ end
138
+ end
139
+ end
140
+
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,61 @@
1
+ require "yaml"
2
+
3
+ module GemSuit
4
+ class CLI < Thor
5
+ module Config
6
+
7
+ class Hash
8
+ def initialize(file, default = {})
9
+ @filename = file
10
+ @hash ||= ::Thor::CoreExt::HashWithIndifferentAccess.new File.exists?(@filename) ? YAML.load_file(@filename) : default
11
+ end
12
+
13
+ def dump
14
+ YAML.dump hash.inject({}){|h, (k, v)| h[k.to_sym] = v; h}
15
+ end
16
+
17
+ def to_str
18
+ hash.collect do |key, value|
19
+ val = case value.class.name
20
+ when "Array"
21
+ value.join ","
22
+ else
23
+ value
24
+ end
25
+ "#{key}=#{val}"
26
+ end.join "\n"
27
+ end
28
+
29
+ def [](key)
30
+ hash[key]
31
+ end
32
+
33
+ def []=(key, value)
34
+ hash[key] = value
35
+ dump_file
36
+ end
37
+
38
+ private
39
+
40
+ def method_missing(method, *args)
41
+ if hash.respond_to?(method) || method.to_s =~ /^(\w+)\?$/
42
+ hash.send method, *args
43
+ else
44
+ super
45
+ end
46
+ end
47
+
48
+ def hash
49
+ @hash
50
+ end
51
+
52
+ def dump_file
53
+ File.open @filename, "w" do |file|
54
+ file << dump
55
+ end
56
+ end
57
+ end
58
+
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,37 @@
1
+ require "gem_suit/cli/config/hash"
2
+
3
+ module GemSuit
4
+ class CLI < Thor
5
+ module Config
6
+
7
+ FILENAME = ".suit"
8
+
9
+ def self.included(base)
10
+ base.send :include, InstanceMethods
11
+ end
12
+
13
+ module InstanceMethods
14
+
15
+ def configure_suit
16
+ suit_config[:mysql] = options.key?("mysql") ? options.mysql : agree?("Do you want to use a MySQL test database?", :no)
17
+ suit_config[:capybara] = options.key?("capybara") ? options.capybara : agree?("Do you want to use Capybara for testing?" , :yes)
18
+ suit_config[:version] = GemSuit::VERSION::STRING
19
+ end
20
+
21
+ def suit_config_global
22
+ @suit_config_global ||= Config::Hash.new File.expand_path(FILENAME, suit_gem_path)
23
+ end
24
+
25
+ def suit_config
26
+ @suit_config ||= Config::Hash.new FILENAME, suit_config_global
27
+ end
28
+
29
+ def suit_config?
30
+ File.exists? FILENAME
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,145 @@
1
+ require "thor"
2
+ require "rich/support/core/string/colorize"
3
+ require "gem_suit/cli/base"
4
+ require "gem_suit/cli/config"
5
+ require "gem_suit/cli/builder"
6
+ require "gem_suit/cli/application"
7
+ require "gem_suit/version"
8
+
9
+ module GemSuit
10
+ class CLI < Thor
11
+
12
+ class Error < StandardError; end
13
+
14
+ include Base
15
+ include Config
16
+ include Builder
17
+ include Application
18
+
19
+ default_task :test
20
+
21
+ desc "tailor NAME", "Generate a Bundler gem and provide it with GemSuit"
22
+ method_options [:interactive, "-i"] => false, [:extras, "-e"] => true, [:mysql, "-m"] => :boolean, [:capybara, "-c"] => :boolean, [:verbose, "-v"] => false
23
+ def tailor(name)
24
+ execute "bundle gem #{name}"
25
+
26
+ opts = options.collect do |key, value|
27
+ ["-", ("-no" unless value), "-#{key}"].compact.join "" if [:interactive, :extras, :mysql, :capybara, :verbose].include?(key.to_sym)
28
+ end.compact.join " "
29
+
30
+ system "cd #{name} && suit up #{opts}"
31
+ end
32
+
33
+ desc "up", "Provide an existing gem with GemSuit"
34
+ method_options [:interactive, "-i"] => false, [:extras, "-e"] => true, [:mysql, "-m"] => :boolean, [:capybara, "-c"] => :boolean, [:verbose, "-v"] => false
35
+ def up
36
+ assert_gem_dir true
37
+ create_shared_assets
38
+ configure_suit
39
+ create_rails_apps
40
+ generate_files
41
+
42
+ opts = options.collect do |key, value|
43
+ ["-", ("-no" unless value), "-#{key}"].compact.join "" if [:verbose].include?(key.to_sym)
44
+ end.compact.join " "
45
+
46
+ system "suit fit #{opts} --no-rake_install"
47
+ puts "Barney Stinson says: 'Cheers! Your gem just got a little more legend!'".green
48
+ end
49
+
50
+ # desc "check", "Check whether GemSuit requirements are satisfied"
51
+ # def check
52
+ # assert_suit_dir
53
+ # # Do we have all the Rails dummy apps installed?
54
+ # # Barney says: 'Your gem is already awesome' || Barney says: 'Run `suit up` to be more legend'
55
+ # end
56
+
57
+ desc "fit", "Establish the GemSuit in your environment"
58
+ method_options [:rake_install, "-i"] => true, [:verbose, "-v"] => false
59
+ def fit
60
+ assert_suit_dir
61
+ restore
62
+ bundle_install
63
+ bundle_install_apps
64
+ rake_install if options.rake_install?
65
+ ask_mysql_password
66
+ create_mysql_test_database
67
+ create_development_databases
68
+ end
69
+
70
+ desc "config [global]", "Configure GemSuit within your gem (use `suit config global` for global config)"
71
+ method_options [:rails_versions, "-r"] => :array, [:mysql, "-m"] => :boolean, [:capybara, "-c"] => :boolean
72
+ def config(env = nil)
73
+ global_options = [:rails_versions]
74
+ case env
75
+ when "global"
76
+ if options.empty?
77
+ log suit_config_global.to_str, true
78
+ else
79
+ options.reject{|k, v| !global_options.include? k.to_sym}.each do |key, value|
80
+ suit_config_global[key] = value
81
+ end
82
+ end
83
+ when nil
84
+ assert_suit_dir
85
+ if options.empty?
86
+ log suit_config.to_str, true
87
+ else
88
+ options.reject{|k, v| global_options.include? k.to_sym}.each do |key, value|
89
+ suit_config[key] = value
90
+ end
91
+ end
92
+ else
93
+ raise Error, "Invalid config enviroment #{env.inspect}"
94
+ end
95
+ end
96
+
97
+ desc "server [ENVIRONMENT]", "Start one of the GemSuit test application servers"
98
+ method_options [:rails_version, "-r"] => :integer, [:port, "-p"] => :integer
99
+ map "s" => :server
100
+ def server(environment = "development")
101
+ rails :server, environment
102
+ end
103
+
104
+ desc "console [ENVIRONMENT]", "Start one of the GemSuit test application consoles"
105
+ method_options [:rails_version, "-r"] => :integer
106
+ map "c" => :console
107
+ def console(environment = "development")
108
+ rails :console, environment
109
+ end
110
+
111
+ desc "test [SECTION] [FILES]", "Run GemSuit (suit, unit, functional, integration) tests"
112
+ method_options [:rails_versions, "-r"] => :array, [:verbose, "-v"] => false, [:very_verbose, "-w"] => false
113
+ def test(section = "suit", file_or_pattern = nil)
114
+ if Application::InstanceMethods.instance_methods.include?(method = "test_#{section}")
115
+ send method, file_or_pattern
116
+ elsif file_or_pattern.nil?
117
+ test_suit section
118
+ else
119
+ raise Error, "Unrecognized test section '#{section}'. Either leave it empty or pass 'suit', 'unit', 'functional' or 'integration'"
120
+ end
121
+ end
122
+
123
+ desc "restore", "Restore all files within the GemSuit test applications"
124
+ method_options [:verbose, "-v"] => false
125
+ def restore
126
+ files :restore
127
+ end
128
+
129
+ desc "bundle", "Run `bundle install` (should be invoked from a Rails dummy application) only when necessary (used for testing)"
130
+ def bundle
131
+ assert_rails_dir
132
+ if `bundle check`.any?{|line| line.include? "`bundle install`"}
133
+ puts "Running `bundle install` (this can take several minutes...)".yellow
134
+ system "bundle install"
135
+ end
136
+ end
137
+
138
+ private
139
+
140
+ def method_missing(method, *args)
141
+ raise Error, "Unrecognized command \"#{method}\". Please consult `suit help`."
142
+ end
143
+
144
+ end
145
+ end
@@ -0,0 +1,14 @@
1
+ # http://techiferous.com/2010/04/using-capybara-in-rails-3 FTW!
2
+
3
+ require "capybara/rails"
4
+
5
+ module GemSuit
6
+ class IntegrationTest < ::ActionController::IntegrationTest
7
+ include Capybara
8
+ end
9
+ end
10
+
11
+ Capybara.register_driver(driver = :"selenium_firefox") do |app|
12
+ Capybara::Driver::Selenium.new app, :profile => "default"
13
+ end
14
+ Capybara.default_driver = driver
@@ -0,0 +1,17 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ caller_dir = File.dirname(caller.detect{|x| !x.include? "custom_require.rb"})
4
+ rails_root = File.expand_path "..", caller_dir
5
+ rails_root = File.expand_path Dir["#{caller_dir}/../../rails-*/dummy"].last unless File.exists? "#{rails_root}/config/environment.rb"
6
+ gem_dir = File.expand_path "../../..", rails_root
7
+
8
+ system "cd #{gem_dir} && suit restore"
9
+ system "cd #{rails_root} && suit bundle"
10
+
11
+ begin
12
+ require "#{rails_root}/config/environment"
13
+ rescue LoadError => e
14
+ puts "ERROR: #{e.message}\n\n"
15
+ end
16
+
17
+ require "#{"rails/" if Rails::VERSION::MAJOR >= 3}test_help"
@@ -0,0 +1,9 @@
1
+ module GemSuit
2
+ module VERSION
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join(".")
8
+ end
9
+ end
data/lib/gem_suit.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "gem_suit/version"
2
+
3
+ module GemSuit
4
+ autoload :Application , "gem_suit/application"
5
+ autoload :IntegrationTest, "gem_suit/integration_test"
6
+ end
@@ -0,0 +1,5 @@
1
+ = <%= camelize gem_name %> CHANGELOG
2
+
3
+ == Version 0.0.1 (<%= Time.now.strftime "%B xxx, %Y" %>)
4
+
5
+ * Initial release
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "<%= rails_gem_version %>"
4
+ gem "sqlite3-ruby", :require => "sqlite3"
5
+
6
+ gem "<%= gem_name %>", :path => File.expand_path("../../../..", __FILE__)
7
+
8
+ group :test do
9
+ gem "mysql"
10
+ gem "shoulda"
11
+ gem "mocha"
12
+ gem "capybara"
13
+ gem "launchy"
14
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) <%= Time.now.strftime "%Y" %> <%= author %>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,35 @@
1
+ h1. <%= camelize gem_name %>
2
+
3
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor.
4
+
5
+ h2. Introduction
6
+
7
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
8
+
9
+ h2. Installation
10
+
11
+ Run the following command in your console:
12
+
13
+ <pre>
14
+ gem install <%= gem_name %>
15
+ </pre>
16
+
17
+ h2. Usage
18
+
19
+ Lorem ipsum.
20
+
21
+ h2. Contact me
22
+
23
+ For support, remarks and requests please mail me at "<%= email %>":mailto:<%= email %>.
24
+
25
+ h2. License
26
+
27
+ Copyright (c) <%= Time.now.strftime "%Y" %> <%= author %>, released under the MIT license
28
+
29
+ <% unless twitter.empty? %>"http://twitter.com/<%= twitter %>":http://twitter.com/<%= twitter %> – <% end %>"<%= email %>":mailto:<%= email %>
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,13 @@
1
+ class Rails::Boot
2
+ def run
3
+ load_initializer
4
+
5
+ Rails::Initializer.class_eval do
6
+ def load_gems
7
+ @bundler_loaded ||= Bundler.require :default, Rails.env
8
+ end
9
+ end
10
+
11
+ Rails::Initializer.run(:set_load_path)
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ begin
2
+ require "rubygems"
3
+ require "bundler"
4
+ rescue LoadError
5
+ raise "Could not load the bundler gem. Install it with `gem install bundler`."
6
+ end
7
+
8
+ if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
9
+ raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
10
+ "Run `gem install bundler` to upgrade."
11
+ end
12
+
13
+ begin
14
+ # Set up load paths for all bundled gems
15
+ ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
16
+ Bundler.setup
17
+ rescue Bundler::GemNotFound
18
+ raise RuntimeError, "Bundler couldn't find some gems." +
19
+ "Did you run `bundle install`?"
20
+ end
@@ -0,0 +1,9 @@
1
+ .DS_Store
2
+ .bundle
3
+ *.gem
4
+ Gemfile.lock
5
+ pkg/*
6
+ suit/rails-*/dummy/db/test.sqlite3
7
+ suit/rails-*/dummy/log/*.log
8
+ suit/rails-*/dummy/tmp/*
9
+ suit/shared/mysql
@@ -0,0 +1,16 @@
1
+ <div class="content">
2
+ <h1><%= camelize gem_name %> <%%= Rails.env %> app</h1>
3
+ <div class="left">
4
+ <p>
5
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
6
+ </p>
7
+ </div>
8
+ <ul>
9
+ <li>
10
+ <%%= link_to "Home", "/" %>
11
+ </li>
12
+ <li>
13
+ <%%= link_to "GemSuit", "https://github.com/archan937/gem_suit" %>
14
+ </li>
15
+ </ul>
16
+ </div>
@@ -0,0 +1,99 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ outline: 0; }
5
+
6
+ html, body {
7
+ height: 100%; }
8
+
9
+ body {
10
+ color: #111;
11
+ font-family: Myriad Pro, Arial;
12
+ font-size: 18px;
13
+ line-height: 120%;
14
+ text-shadow: white 0 2px 0;
15
+ background: #E0E0E0; }
16
+
17
+ ol, ul {
18
+ list-style: none; }
19
+
20
+ a {
21
+ padding-bottom: 1px;
22
+ color: #111;
23
+ cursor: pointer;
24
+ text-decoration: none; }
25
+
26
+ a:hover {
27
+ text-decoration: underline; }
28
+
29
+ abbr, fieldset, img {
30
+ border: 0; }
31
+
32
+ textarea {
33
+ font-family: Myriad Pro, Arial; }
34
+
35
+ #page {
36
+ width: 750px;
37
+ min-height: 100%;
38
+ margin: 0 auto; }
39
+
40
+ #page div.locales {
41
+ padding-top: 80px;
42
+ text-align: center; }
43
+
44
+ #page div.locales a img {
45
+ margin: 0 2px;
46
+ padding: 2px; }
47
+
48
+ #page div.locales a.selected img {
49
+ padding: 1px;
50
+ border: 1px solid #06F; }
51
+
52
+ #page div.content {
53
+ padding-top: 80px;
54
+ clear: both; }
55
+
56
+ #page div.content h1 {
57
+ margin-bottom: 35px; }
58
+
59
+ #page div.content div.left {
60
+ width: 515px;
61
+ float: left; }
62
+
63
+ #page div.content div.left h3 {
64
+ font-size: 22px;
65
+ margin-bottom: 22px; }
66
+
67
+ #page div.content div.left p {
68
+ margin-bottom: 30px;
69
+ font-size: 18px;
70
+ line-height: 140%; }
71
+
72
+ #page div.content div.left form label {
73
+ display: block;
74
+ font-weight: bold; }
75
+
76
+ #page div.content div.left form .inputs input {
77
+ margin-bottom: 15px;
78
+ width: 350px;
79
+ font-size: 16px; }
80
+
81
+ #page div.content div.left form .inputs textarea {
82
+ width: 400px;
83
+ height: 150px;
84
+ font-size: 18px; }
85
+
86
+ #page div.content div.left form .buttons {
87
+ padding: 15px 0 60px 0; }
88
+
89
+ #page div.content div.left form .buttons input {
90
+ margin-right: 6px;
91
+ font-size: 16px; }
92
+
93
+ #page div.content div.left form .buttons a {
94
+ font-size: 14px; }
95
+
96
+ #page div.content ul {
97
+ width: 175px;
98
+ font-weight: bold;
99
+ float: right; }