bootswitch 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +19 -0
  6. data/LICENSE.txt +177 -0
  7. data/README.rdoc +38 -0
  8. data/Rakefile +53 -0
  9. data/VERSION +1 -0
  10. data/app/assets/stylesheets/bootswatch/amelia/bootswatch.css.scss +136 -0
  11. data/app/assets/stylesheets/bootswatch/amelia/theme.css.scss +9 -0
  12. data/app/assets/stylesheets/bootswatch/amelia/variables.css.scss +624 -0
  13. data/app/assets/stylesheets/bootswatch/cerulean/bootswatch.css.scss +159 -0
  14. data/app/assets/stylesheets/bootswatch/cerulean/theme.css.scss +9 -0
  15. data/app/assets/stylesheets/bootswatch/cerulean/variables.css.scss +621 -0
  16. data/app/assets/stylesheets/bootswatch/cosmo/bootswatch.css.scss +138 -0
  17. data/app/assets/stylesheets/bootswatch/cosmo/theme.css.scss +9 -0
  18. data/app/assets/stylesheets/bootswatch/cosmo/variables.css.scss +623 -0
  19. data/app/assets/stylesheets/bootswatch/custom/bootswatch.css.scss +22 -0
  20. data/app/assets/stylesheets/bootswatch/custom/theme.css.scss +9 -0
  21. data/app/assets/stylesheets/bootswatch/custom/variables.css.scss +620 -0
  22. data/app/assets/stylesheets/bootswatch/cyborg/bootswatch.css.scss +141 -0
  23. data/app/assets/stylesheets/bootswatch/cyborg/theme.css.scss +9 -0
  24. data/app/assets/stylesheets/bootswatch/cyborg/variables.css.scss +624 -0
  25. data/app/assets/stylesheets/bootswatch/darkly/bootswatch.css.scss +234 -0
  26. data/app/assets/stylesheets/bootswatch/darkly/theme.css.scss +9 -0
  27. data/app/assets/stylesheets/bootswatch/darkly/variables.css.scss +831 -0
  28. data/app/assets/stylesheets/bootswatch/flatly/bootswatch.css.scss +177 -0
  29. data/app/assets/stylesheets/bootswatch/flatly/theme.css.scss +9 -0
  30. data/app/assets/stylesheets/bootswatch/flatly/variables.css.scss +623 -0
  31. data/app/assets/stylesheets/bootswatch/global/build.css.scss +3 -0
  32. data/app/assets/stylesheets/bootswatch/global/theme.css.scss +9 -0
  33. data/app/assets/stylesheets/bootswatch/journal/bootswatch.css.scss +96 -0
  34. data/app/assets/stylesheets/bootswatch/journal/theme.css.scss +9 -0
  35. data/app/assets/stylesheets/bootswatch/journal/variables.css.scss +622 -0
  36. data/app/assets/stylesheets/bootswatch/readable/bootswatch.css.scss +83 -0
  37. data/app/assets/stylesheets/bootswatch/readable/theme.css.scss +9 -0
  38. data/app/assets/stylesheets/bootswatch/readable/variables.css.scss +623 -0
  39. data/app/assets/stylesheets/bootswatch/simplex/bootswatch.css.scss +127 -0
  40. data/app/assets/stylesheets/bootswatch/simplex/theme.css.scss +9 -0
  41. data/app/assets/stylesheets/bootswatch/simplex/variables.css.scss +624 -0
  42. data/app/assets/stylesheets/bootswatch/slate/bootswatch.css.scss +328 -0
  43. data/app/assets/stylesheets/bootswatch/slate/theme.css.scss +9 -0
  44. data/app/assets/stylesheets/bootswatch/slate/variables.css.scss +622 -0
  45. data/app/assets/stylesheets/bootswatch/spacelab/bootswatch.css.scss +115 -0
  46. data/app/assets/stylesheets/bootswatch/spacelab/theme.css.scss +9 -0
  47. data/app/assets/stylesheets/bootswatch/spacelab/variables.css.scss +623 -0
  48. data/app/assets/stylesheets/bootswatch/superhero/bootswatch.css.scss +250 -0
  49. data/app/assets/stylesheets/bootswatch/superhero/theme.css.scss +9 -0
  50. data/app/assets/stylesheets/bootswatch/superhero/variables.css.scss +833 -0
  51. data/app/assets/stylesheets/bootswatch/united/bootswatch.css.scss +31 -0
  52. data/app/assets/stylesheets/bootswatch/united/theme.css.scss +9 -0
  53. data/app/assets/stylesheets/bootswatch/united/variables.css.scss +623 -0
  54. data/app/assets/stylesheets/bootswatch/yeti/bootswatch.css.scss +408 -0
  55. data/app/assets/stylesheets/bootswatch/yeti/theme.css.scss +9 -0
  56. data/app/assets/stylesheets/bootswatch/yeti/variables.css.scss +831 -0
  57. data/app/controllers/bootswitch_controller.rb +2 -0
  58. data/app/controllers/theme_controller.rb +17 -0
  59. data/app/helpers/theme_helper.rb +9 -0
  60. data/app/views/theme/_stylesheet_link_tag.html.haml +1 -0
  61. data/bootswitch.gemspec +156 -0
  62. data/config/routes.rb +4 -0
  63. data/lib/bootswitch/configuration.rb +20 -0
  64. data/lib/bootswitch/engine.rb +5 -0
  65. data/lib/bootswitch/railtie.rb +4 -0
  66. data/lib/bootswitch/version.rb +7 -0
  67. data/lib/bootswitch.rb +11 -0
  68. data/lib/generators/bootswitch/install/install_generator.rb +23 -0
  69. data/lib/generators/bootswitch/install/templates/initializer.rb +4 -0
  70. data/lib/generators/bootswitch/utils.rb +16 -0
  71. data/script/rails +6 -0
  72. data/spec/dummy/.rspec +1 -0
  73. data/spec/dummy/Rakefile +7 -0
  74. data/spec/dummy/app/assets/javascripts/application.js +2 -0
  75. data/spec/dummy/app/assets/stylesheets/application.css.scss +14 -0
  76. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  77. data/spec/dummy/app/helpers/application_helper.rb +5 -0
  78. data/spec/dummy/config/application.rb +27 -0
  79. data/spec/dummy/config/boot.rb +10 -0
  80. data/spec/dummy/config/environment.rb +5 -0
  81. data/spec/dummy/config/environments/development.rb +23 -0
  82. data/spec/dummy/config/environments/test.rb +17 -0
  83. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  84. data/spec/dummy/config/initializers/bootswitch.rb +4 -0
  85. data/spec/dummy/config/initializers/inflections.rb +15 -0
  86. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  87. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  88. data/spec/dummy/config/initializers/session_store.rb +8 -0
  89. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  90. data/spec/dummy/config/routes.rb +53 -0
  91. data/spec/dummy/config.ru +4 -0
  92. data/spec/dummy/public/404.html +26 -0
  93. data/spec/dummy/public/422.html +26 -0
  94. data/spec/dummy/public/500.html +25 -0
  95. data/spec/dummy/public/favicon.ico +0 -0
  96. data/spec/dummy/public/index.html +101 -0
  97. data/spec/dummy/script/rails +6 -0
  98. data/spec/helpers/theme_helper_spec.rb +14 -0
  99. data/spec/spec_helper.rb +18 -0
  100. metadata +243 -0
@@ -0,0 +1,2 @@
1
+ class BootswitchController < ApplicationController
2
+ end
@@ -0,0 +1,17 @@
1
+ class ThemeController < BootswitchController
2
+ def variables
3
+ respond_to do |format|
4
+ format.css { render :file => "bootswatch/" + theme_name + "/variables", :handlers => [:scss]}
5
+ end
6
+ end
7
+ def theme
8
+ respond_to do |format|
9
+ format.css { render :file => "bootswatch/" + theme_name + "/theme", :handlers => [:scss]}
10
+ end
11
+ end
12
+ def layout
13
+ respond_to do |format|
14
+ format.css { render :file => "bootswatch/" + theme_name + "/bootswatch", :handlers => [:scss]}
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module ThemeHelper
2
+ def theme_name
3
+ send(Bootswitch.configuration.theme_method)
4
+ end
5
+
6
+ def theme_stylesheet_link_tag
7
+ render(partial: 'stylesheet_link_tag')
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ = stylesheet_link_tag 'bootswatch/'+ theme_name + '/theme'
@@ -0,0 +1,156 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: bootswitch 0.0.1 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "bootswitch"
9
+ s.version = "0.0.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Karen Lundgren"]
14
+ s.date = "2014-05-07"
15
+ s.description = "Bootswitch is designed to get you up and running with a customizable version of boostrap using SASS."
16
+ s.email = "webmaster@sourcherryweb.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".rspec",
24
+ ".travis.yml",
25
+ "Gemfile",
26
+ "LICENSE.txt",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "app/assets/stylesheets/bootswatch/amelia/bootswatch.css.scss",
31
+ "app/assets/stylesheets/bootswatch/amelia/theme.css.scss",
32
+ "app/assets/stylesheets/bootswatch/amelia/variables.css.scss",
33
+ "app/assets/stylesheets/bootswatch/cerulean/bootswatch.css.scss",
34
+ "app/assets/stylesheets/bootswatch/cerulean/theme.css.scss",
35
+ "app/assets/stylesheets/bootswatch/cerulean/variables.css.scss",
36
+ "app/assets/stylesheets/bootswatch/cosmo/bootswatch.css.scss",
37
+ "app/assets/stylesheets/bootswatch/cosmo/theme.css.scss",
38
+ "app/assets/stylesheets/bootswatch/cosmo/variables.css.scss",
39
+ "app/assets/stylesheets/bootswatch/custom/bootswatch.css.scss",
40
+ "app/assets/stylesheets/bootswatch/custom/theme.css.scss",
41
+ "app/assets/stylesheets/bootswatch/custom/variables.css.scss",
42
+ "app/assets/stylesheets/bootswatch/cyborg/bootswatch.css.scss",
43
+ "app/assets/stylesheets/bootswatch/cyborg/theme.css.scss",
44
+ "app/assets/stylesheets/bootswatch/cyborg/variables.css.scss",
45
+ "app/assets/stylesheets/bootswatch/darkly/bootswatch.css.scss",
46
+ "app/assets/stylesheets/bootswatch/darkly/theme.css.scss",
47
+ "app/assets/stylesheets/bootswatch/darkly/variables.css.scss",
48
+ "app/assets/stylesheets/bootswatch/flatly/bootswatch.css.scss",
49
+ "app/assets/stylesheets/bootswatch/flatly/theme.css.scss",
50
+ "app/assets/stylesheets/bootswatch/flatly/variables.css.scss",
51
+ "app/assets/stylesheets/bootswatch/global/build.css.scss",
52
+ "app/assets/stylesheets/bootswatch/global/theme.css.scss",
53
+ "app/assets/stylesheets/bootswatch/journal/bootswatch.css.scss",
54
+ "app/assets/stylesheets/bootswatch/journal/theme.css.scss",
55
+ "app/assets/stylesheets/bootswatch/journal/variables.css.scss",
56
+ "app/assets/stylesheets/bootswatch/readable/bootswatch.css.scss",
57
+ "app/assets/stylesheets/bootswatch/readable/theme.css.scss",
58
+ "app/assets/stylesheets/bootswatch/readable/variables.css.scss",
59
+ "app/assets/stylesheets/bootswatch/simplex/bootswatch.css.scss",
60
+ "app/assets/stylesheets/bootswatch/simplex/theme.css.scss",
61
+ "app/assets/stylesheets/bootswatch/simplex/variables.css.scss",
62
+ "app/assets/stylesheets/bootswatch/slate/bootswatch.css.scss",
63
+ "app/assets/stylesheets/bootswatch/slate/theme.css.scss",
64
+ "app/assets/stylesheets/bootswatch/slate/variables.css.scss",
65
+ "app/assets/stylesheets/bootswatch/spacelab/bootswatch.css.scss",
66
+ "app/assets/stylesheets/bootswatch/spacelab/theme.css.scss",
67
+ "app/assets/stylesheets/bootswatch/spacelab/variables.css.scss",
68
+ "app/assets/stylesheets/bootswatch/superhero/bootswatch.css.scss",
69
+ "app/assets/stylesheets/bootswatch/superhero/theme.css.scss",
70
+ "app/assets/stylesheets/bootswatch/superhero/variables.css.scss",
71
+ "app/assets/stylesheets/bootswatch/united/bootswatch.css.scss",
72
+ "app/assets/stylesheets/bootswatch/united/theme.css.scss",
73
+ "app/assets/stylesheets/bootswatch/united/variables.css.scss",
74
+ "app/assets/stylesheets/bootswatch/yeti/bootswatch.css.scss",
75
+ "app/assets/stylesheets/bootswatch/yeti/theme.css.scss",
76
+ "app/assets/stylesheets/bootswatch/yeti/variables.css.scss",
77
+ "app/controllers/bootswitch_controller.rb",
78
+ "app/controllers/theme_controller.rb",
79
+ "app/helpers/theme_helper.rb",
80
+ "app/views/theme/_stylesheet_link_tag.html.haml",
81
+ "bootswitch.gemspec",
82
+ "config/routes.rb",
83
+ "lib/bootswitch.rb",
84
+ "lib/bootswitch/configuration.rb",
85
+ "lib/bootswitch/engine.rb",
86
+ "lib/bootswitch/railtie.rb",
87
+ "lib/bootswitch/version.rb",
88
+ "lib/generators/bootswitch/install/install_generator.rb",
89
+ "lib/generators/bootswitch/install/templates/initializer.rb",
90
+ "lib/generators/bootswitch/utils.rb",
91
+ "script/rails",
92
+ "spec/dummy/.rspec",
93
+ "spec/dummy/Rakefile",
94
+ "spec/dummy/app/assets/javascripts/application.js",
95
+ "spec/dummy/app/assets/stylesheets/application.css.scss",
96
+ "spec/dummy/app/controllers/application_controller.rb",
97
+ "spec/dummy/app/helpers/application_helper.rb",
98
+ "spec/dummy/config.ru",
99
+ "spec/dummy/config/application.rb",
100
+ "spec/dummy/config/boot.rb",
101
+ "spec/dummy/config/environment.rb",
102
+ "spec/dummy/config/environments/development.rb",
103
+ "spec/dummy/config/environments/test.rb",
104
+ "spec/dummy/config/initializers/backtrace_silencers.rb",
105
+ "spec/dummy/config/initializers/bootswitch.rb",
106
+ "spec/dummy/config/initializers/inflections.rb",
107
+ "spec/dummy/config/initializers/mime_types.rb",
108
+ "spec/dummy/config/initializers/secret_token.rb",
109
+ "spec/dummy/config/initializers/session_store.rb",
110
+ "spec/dummy/config/initializers/wrap_parameters.rb",
111
+ "spec/dummy/config/routes.rb",
112
+ "spec/dummy/public/404.html",
113
+ "spec/dummy/public/422.html",
114
+ "spec/dummy/public/500.html",
115
+ "spec/dummy/public/favicon.ico",
116
+ "spec/dummy/public/index.html",
117
+ "spec/dummy/script/rails",
118
+ "spec/helpers/theme_helper_spec.rb",
119
+ "spec/spec_helper.rb"
120
+ ]
121
+ s.homepage = "http://github.com/nerakdon/bootswitch"
122
+ s.licenses = ["MIT"]
123
+ s.rubygems_version = "2.2.2"
124
+ s.summary = "Designed to get you up and running with a customizable version of boostrap using SASS."
125
+
126
+ if s.respond_to? :specification_version then
127
+ s.specification_version = 4
128
+
129
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
130
+ s.add_runtime_dependency(%q<rails>, [">= 4.1"])
131
+ s.add_runtime_dependency(%q<haml-rails>, [">= 0"])
132
+ s.add_runtime_dependency(%q<bootstrap-sass>, [">= 0"])
133
+ s.add_runtime_dependency(%q<bootswitch>, [">= 0"])
134
+ s.add_development_dependency(%q<rdoc>, [">= 0"])
135
+ s.add_development_dependency(%q<bundler>, [">= 0"])
136
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
137
+ else
138
+ s.add_dependency(%q<rails>, [">= 4.1"])
139
+ s.add_dependency(%q<haml-rails>, [">= 0"])
140
+ s.add_dependency(%q<bootstrap-sass>, [">= 0"])
141
+ s.add_dependency(%q<bootswitch>, [">= 0"])
142
+ s.add_dependency(%q<rdoc>, [">= 0"])
143
+ s.add_dependency(%q<bundler>, [">= 0"])
144
+ s.add_dependency(%q<jeweler>, [">= 0"])
145
+ end
146
+ else
147
+ s.add_dependency(%q<rails>, [">= 4.1"])
148
+ s.add_dependency(%q<haml-rails>, [">= 0"])
149
+ s.add_dependency(%q<bootstrap-sass>, [">= 0"])
150
+ s.add_dependency(%q<bootswitch>, [">= 0"])
151
+ s.add_dependency(%q<rdoc>, [">= 0"])
152
+ s.add_dependency(%q<bundler>, [">= 0"])
153
+ s.add_dependency(%q<jeweler>, [">= 0"])
154
+ end
155
+ end
156
+
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Bootswitch::Engine.routes.draw do
2
+ get 'variables', to: 'bootswatch#variables'
3
+ get 'layout', to: 'bootswatch#layout'
4
+ end
@@ -0,0 +1,20 @@
1
+ module Bootswitch
2
+ def self.configure(configuration = Bootswitch::Configuration.new)
3
+ if block_given?
4
+ yield configuration
5
+ end
6
+ @@configuration = configuration
7
+ end
8
+
9
+ def self.configuration
10
+ @@configuration ||= Bootswitch::Configuration.new
11
+ end
12
+
13
+ class Configuration
14
+ attr_accessor :theme_method
15
+
16
+ def initialize
17
+ self.theme_method = nil
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ module Bootswitch
2
+ class Engine < Rails::Engine
3
+ # isolate_namespace Bootswitch
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Bootswitch
2
+ class Railtie < Rails::Railtie
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module Bootswitch
2
+ VERSION = File.read(File.expand_path('../../../VERSION', __FILE__))
3
+
4
+ def self.version_string
5
+ "Bootswitch version #{Bootswitch::VERSION}"
6
+ end
7
+ end
data/lib/bootswitch.rb ADDED
@@ -0,0 +1,11 @@
1
+ module Bootswitch
2
+ require 'rails'
3
+ require 'haml'
4
+
5
+ require 'bootswitch/engine'
6
+ require 'bootswitch/configuration'
7
+ require 'bootswitch/railtie'
8
+ require 'bootswitch/version'
9
+
10
+ require 'bootstrap-sass'
11
+ end
@@ -0,0 +1,23 @@
1
+ module Bootswitch
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+ require File.expand_path('../../utils', __FILE__)
5
+ include Generators::Utils
6
+
7
+ def hello
8
+ output "Welcome to the Bootswitch gem's installation process.", :magenta
9
+ end
10
+
11
+ # all public methods in here will be run in order
12
+ def install_initializer
13
+ output "This installs a basic initializer where you can set the method that stores the name of the bootswatch bootswatch to be displayed.", :magenta
14
+ template "initializer.rb", "config/initializers/bootswitch.rb"
15
+ end
16
+
17
+ def add_route
18
+ output "Adding Bootswitch to your routes.rb file", :magenta
19
+ gsub_file "config/routes.rb", /mount Bootswitch::Engine => '\/bootswatch\/', :as => 'bootswitch'/, ''
20
+ route("mount Bootswitch::Engine => '/bootswatch/', :as => 'bootswitch'")
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ Bootswitch.configure do |config|
2
+ # What helper method should determine the bootswatch theme displayed?
3
+ config.theme_method = :user_theme
4
+ end
@@ -0,0 +1,16 @@
1
+ module Bootswitch
2
+ module Generators
3
+ module Utils
4
+ def output(output, color = :green)
5
+ say(" - #{output}", color)
6
+ end
7
+
8
+ def ask_for(wording, default_value = nil, override_if_present_value = nil)
9
+ override_if_present_value.present? ?
10
+ display("Using [#{override_if_present_value}] for question '#{wording}'") && override_if_present_value :
11
+ ask(" ? #{wording} Press <enter> for [#{default_value}] >", :yellow).presence || default_value
12
+ end
13
+ end
14
+ end
15
+ end
16
+
data/script/rails ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby1.8
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__)
5
+ require File.expand_path('../../spec/dummy/config/boot', __FILE__)
6
+ require 'rails/commands'
data/spec/dummy/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,2 @@
1
+ //= require jquery
2
+ //= require bootstrap
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
14
+
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+
3
+ end
@@ -0,0 +1,5 @@
1
+ module ApplicationHelper
2
+ def random_theme
3
+ ['amelia', 'cerulean', 'cosmo', 'custom', 'cyborg', 'darkly', 'flatly','global','journal','readable','simplex','slate','spacelab','superhero','united','yeti'].sample
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "action_controller/railtie"
5
+ require "sprockets/railtie"
6
+ # require "rails/test_unit/railtie"
7
+
8
+ Bundler.require
9
+ require "bootswitch"
10
+
11
+ module Dummy
12
+ class Application < Rails::Application
13
+
14
+ # Configure the default encoding used in templates for Ruby 1.9.
15
+ config.encoding = "utf-8"
16
+
17
+ # Enable escaping HTML in JSON.
18
+ config.active_support.escape_html_entities_in_json = true
19
+
20
+ # Enable the asset pipeline
21
+ config.assets.enabled = true
22
+
23
+ # Version of your assets, change this if you want to expire all your assets
24
+ config.assets.version = '1.0'
25
+ end
26
+ end
27
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,23 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Show full error reports and disable caching
10
+ config.consider_all_requests_local = true
11
+
12
+ # Print deprecation notices to the Rails logger
13
+ config.active_support.deprecation = :log
14
+
15
+ # Only use best-standards-support built into browsers
16
+ config.action_dispatch.best_standards_support = :builtin
17
+
18
+ # Do not compress assets
19
+ config.assets.compress = false
20
+
21
+ # Expands the lines which load the assets
22
+ config.assets.debug = true
23
+ end
@@ -0,0 +1,17 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Show full error reports and disable caching
15
+ config.consider_all_requests_local = true
16
+ config.active_support.deprecation = :stderr
17
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,4 @@
1
+ Bootswitch.configure do |config|
2
+ # What helper method should determine the bootswatch theme displayed?
3
+ config.theme_method = :random_theme
4
+ end
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '13335d67552fdd1870f1e89aa229a259979c25ad14a60a64b75ce77db7622c9728606f2415d021416725905e8ad5955be6fff9e01702167f1ddc0fb4c5f3cfdf'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,53 @@
1
+ Dummy::Application.routes.draw do
2
+ mount Bootswitch::Engine => '/bootswatch/', :as => 'bootswitch'
3
+ # The priority is based upon order of creation:
4
+ # first created -> highest priority.
5
+
6
+ # Sample of regular route:
7
+ # match 'products/:id' => 'catalog#view'
8
+ # Keep in mind you can assign values other than :controller and :action
9
+
10
+ # Sample of named route:
11
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
12
+ # This route can be invoked with purchase_url(:id => product.id)
13
+
14
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Sample resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Sample resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Sample resource route with more complex sub-resources
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', :on => :collection
40
+ # end
41
+ # end
42
+
43
+ # Sample resource route within a namespace:
44
+ # namespace :admin do
45
+ # # Directs /admin/products/* to Admin::ProductsController
46
+ # # (app/helpers/admin/products_controller.rb)
47
+ # resources :products
48
+ # end
49
+
50
+ # You can have the root of your site routed with "root"
51
+ # just remember to delete public/index.html.
52
+ # root :to => 'welcome#index'
53
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>