sassc-rails 1.0.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +17 -6
- data/CODE_OF_CONDUCT.md +10 -0
- data/README.md +36 -12
- data/Rakefile +5 -4
- data/gemfiles/{rails_4_0.gemfile → rails_5_2.gemfile} +1 -1
- data/gemfiles/{sprockets_2_12.gemfile → sprockets-rails_2_3.gemfile} +1 -1
- data/gemfiles/{with_sass_rails.gemfile → sprockets-rails_3_0.gemfile} +1 -1
- data/gemfiles/sprockets_3_0.gemfile +1 -1
- data/gemfiles/{rails_4_1.gemfile → sprockets_4_0.gemfile} +1 -1
- data/lib/rails/generators/sass/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/sass/assets/templates/stylesheet.sass +3 -0
- data/lib/rails/generators/sass/scaffold/scaffold_generator.rb +9 -0
- data/lib/rails/generators/sass_scaffold.rb +15 -0
- data/lib/rails/generators/scss/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/scss/assets/templates/stylesheet.scss +3 -0
- data/lib/rails/generators/scss/scaffold/scaffold_generator.rb +10 -0
- data/lib/sassc/rails/compressor.rb +13 -0
- data/lib/sassc/rails/functions.rb +3 -1
- data/lib/sassc/rails/importer.rb +11 -6
- data/lib/sassc/rails/railtie.rb +23 -8
- data/lib/sassc/rails/template.rb +76 -60
- data/lib/sassc/rails/version.rb +3 -1
- data/lib/sassc/rails.rb +2 -0
- data/lib/sassc-rails.rb +1 -5
- data/sassc-rails.gemspec +7 -10
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/stylesheets/glob_multiple_extensions_test.scss +1 -0
- data/{test_old/fixtures/scss_project/app/assets/stylesheets/css_erb_handler.css.erb → test/dummy/app/assets/stylesheets/globbed_multiple_extensions/glob.scss.erb} +1 -1
- data/test/dummy/app/assets/stylesheets/imports_test.scss +1 -0
- data/test/dummy/app/assets/stylesheets/in_load_paths/partial_in_load_paths.scss +3 -0
- data/test/sassc_rails_test.rb +65 -39
- data/test/test_helper.rb +3 -1
- metadata +49 -245
- data/test_old/fixtures/alternate_config_project/.gitignore +0 -5
- data/test_old/fixtures/alternate_config_project/Gemfile +0 -7
- data/test_old/fixtures/alternate_config_project/README +0 -261
- data/test_old/fixtures/alternate_config_project/Rakefile +0 -7
- data/test_old/fixtures/alternate_config_project/app/assets/images/1x1.png +0 -0
- data/test_old/fixtures/alternate_config_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/alternate_config_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/_top_level_partial.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/application.scss +0 -32
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/css_application.css +0 -11
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/globbed.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_sass_import.sass +0 -5
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_scss_import.scss +0 -9
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +0 -2
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/plain.css +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/second_level.scss +0 -1
- data/test_old/fixtures/alternate_config_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/alternate_config_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/alternate_config_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/alternate_config_project/config/application.rb +0 -49
- data/test_old/fixtures/alternate_config_project/config/boot.rb +0 -6
- data/test_old/fixtures/alternate_config_project/config/database.yml +0 -25
- data/test_old/fixtures/alternate_config_project/config/environment.rb +0 -5
- data/test_old/fixtures/alternate_config_project/config/environments/development.rb +0 -27
- data/test_old/fixtures/alternate_config_project/config/environments/production.rb +0 -60
- data/test_old/fixtures/alternate_config_project/config/environments/test.rb +0 -42
- data/test_old/fixtures/alternate_config_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/alternate_config_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/alternate_config_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/alternate_config_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/alternate_config_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/alternate_config_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/alternate_config_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/alternate_config_project/config/routes.rb +0 -58
- data/test_old/fixtures/alternate_config_project/config.ru +0 -4
- data/test_old/fixtures/alternate_config_project/db/seeds.rb +0 -7
- data/test_old/fixtures/alternate_config_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/alternate_config_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/log/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/public/404.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/422.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/500.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/favicon.ico +0 -0
- data/test_old/fixtures/alternate_config_project/public/index.html +0 -241
- data/test_old/fixtures/alternate_config_project/public/robots.txt +0 -5
- data/test_old/fixtures/alternate_config_project/script/rails +0 -6
- data/test_old/fixtures/engine_project/.gitignore +0 -8
- data/test_old/fixtures/engine_project/Gemfile +0 -14
- data/test_old/fixtures/engine_project/MIT-LICENSE +0 -20
- data/test_old/fixtures/engine_project/README.rdoc +0 -3
- data/test_old/fixtures/engine_project/Rakefile +0 -34
- data/test_old/fixtures/engine_project/app/assets/images/engine_project/.keep +0 -0
- data/test_old/fixtures/engine_project/app/assets/javascripts/engine_project/application.js +0 -16
- data/test_old/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +0 -13
- data/test_old/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +0 -4
- data/test_old/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +0 -4
- data/test_old/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +0 -14
- data/test_old/fixtures/engine_project/config/routes.rb +0 -2
- data/test_old/fixtures/engine_project/engine_project.gemspec +0 -23
- data/test_old/fixtures/engine_project/lib/engine_project/engine.rb +0 -5
- data/test_old/fixtures/engine_project/lib/engine_project/version.rb +0 -3
- data/test_old/fixtures/engine_project/lib/engine_project.rb +0 -4
- data/test_old/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +0 -4
- data/test_old/fixtures/engine_project/script/rails +0 -8
- data/test_old/fixtures/engine_project/test/dummy/README.rdoc +0 -28
- data/test_old/fixtures/engine_project/test/dummy/Rakefile +0 -6
- data/test_old/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +0 -16
- data/test_old/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test_old/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/engine_project/test/dummy/app/mailers/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/models/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/models/concerns/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/engine_project/test/dummy/bin/bundle +0 -3
- data/test_old/fixtures/engine_project/test/dummy/bin/rails +0 -4
- data/test_old/fixtures/engine_project/test/dummy/bin/rake +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config/application.rb +0 -23
- data/test_old/fixtures/engine_project/test/dummy/config/boot.rb +0 -9
- data/test_old/fixtures/engine_project/test/dummy/config/database.yml +0 -25
- data/test_old/fixtures/engine_project/test/dummy/config/environment.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/config/environments/development.rb +0 -27
- data/test_old/fixtures/engine_project/test/dummy/config/environments/production.rb +0 -84
- data/test_old/fixtures/engine_project/test/dummy/config/environments/test.rb +0 -40
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +0 -16
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +0 -12
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +0 -3
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test_old/fixtures/engine_project/test/dummy/config/locales/en.yml +0 -23
- data/test_old/fixtures/engine_project/test/dummy/config/routes.rb +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config.ru +0 -4
- data/test_old/fixtures/engine_project/test/dummy/lib/assets/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/log/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/public/404.html +0 -27
- data/test_old/fixtures/engine_project/test/dummy/public/422.html +0 -26
- data/test_old/fixtures/engine_project/test/dummy/public/500.html +0 -26
- data/test_old/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/.gitignore +0 -5
- data/test_old/fixtures/sass_project/Gemfile +0 -7
- data/test_old/fixtures/sass_project/README +0 -261
- data/test_old/fixtures/sass_project/Rakefile +0 -7
- data/test_old/fixtures/sass_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/sass_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/sass_project/app/assets/stylesheets/application.css +0 -7
- data/test_old/fixtures/sass_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/sass_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/sass_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/sass_project/config/application.rb +0 -52
- data/test_old/fixtures/sass_project/config/boot.rb +0 -6
- data/test_old/fixtures/sass_project/config/database.yml +0 -25
- data/test_old/fixtures/sass_project/config/environment.rb +0 -5
- data/test_old/fixtures/sass_project/config/environments/development.rb +0 -24
- data/test_old/fixtures/sass_project/config/environments/production.rb +0 -58
- data/test_old/fixtures/sass_project/config/environments/test.rb +0 -43
- data/test_old/fixtures/sass_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/sass_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/sass_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/sass_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/sass_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/sass_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/sass_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/sass_project/config/routes.rb +0 -58
- data/test_old/fixtures/sass_project/config.ru +0 -4
- data/test_old/fixtures/sass_project/db/seeds.rb +0 -7
- data/test_old/fixtures/sass_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/sass_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/log/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/public/404.html +0 -26
- data/test_old/fixtures/sass_project/public/422.html +0 -26
- data/test_old/fixtures/sass_project/public/500.html +0 -26
- data/test_old/fixtures/sass_project/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/public/index.html +0 -241
- data/test_old/fixtures/sass_project/public/robots.txt +0 -5
- data/test_old/fixtures/sass_project/script/rails +0 -6
- data/test_old/fixtures/scss_project/.gitignore +0 -5
- data/test_old/fixtures/scss_project/Gemfile +0 -7
- data/test_old/fixtures/scss_project/README +0 -261
- data/test_old/fixtures/scss_project/Rakefile +0 -7
- data/test_old/fixtures/scss_project/app/assets/images/1x1.png +0 -0
- data/test_old/fixtures/scss_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/scss_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/application.scss +0 -38
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_application.css +0 -11
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_sass_erb_handler.sass.erb +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_scss_erb_handler.scss.erb +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/import_css_application.scss +0 -5
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_css_sass_import.sass +0 -5
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.sass +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.scss +0 -9
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/sass_erb_handler.sass.erb +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/scss_erb_handler.scss.erb +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/_defaults.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.scss +0 -2
- data/test_old/fixtures/scss_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/scss_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/scss_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/scss_project/config/application.rb +0 -49
- data/test_old/fixtures/scss_project/config/boot.rb +0 -6
- data/test_old/fixtures/scss_project/config/database.yml +0 -25
- data/test_old/fixtures/scss_project/config/environment.rb +0 -5
- data/test_old/fixtures/scss_project/config/environments/development.rb +0 -23
- data/test_old/fixtures/scss_project/config/environments/production.rb +0 -57
- data/test_old/fixtures/scss_project/config/environments/test.rb +0 -42
- data/test_old/fixtures/scss_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/scss_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/scss_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/scss_project/config/initializers/postprocessor.rb +0 -3
- data/test_old/fixtures/scss_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/scss_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/scss_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/scss_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/scss_project/config/routes.rb +0 -58
- data/test_old/fixtures/scss_project/config.ru +0 -4
- data/test_old/fixtures/scss_project/db/seeds.rb +0 -7
- data/test_old/fixtures/scss_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/scss_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/log/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/public/404.html +0 -26
- data/test_old/fixtures/scss_project/public/422.html +0 -26
- data/test_old/fixtures/scss_project/public/500.html +0 -26
- data/test_old/fixtures/scss_project/public/favicon.ico +0 -0
- data/test_old/fixtures/scss_project/public/index.html +0 -241
- data/test_old/fixtures/scss_project/public/robots.txt +0 -5
- data/test_old/fixtures/scss_project/script/rails +0 -6
- data/test_old/sass_rails_test.rb +0 -203
- data/test_old/support/sass_rails_test_case.rb +0 -181
- data/test_old/test_helper.rb +0 -27
@@ -1,241 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Ruby on Rails: Welcome aboard</title>
|
5
|
-
<style type="text/css" media="screen">
|
6
|
-
body {
|
7
|
-
margin: 0;
|
8
|
-
margin-bottom: 25px;
|
9
|
-
padding: 0;
|
10
|
-
background-color: #f0f0f0;
|
11
|
-
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
|
12
|
-
font-size: 13px;
|
13
|
-
color: #333;
|
14
|
-
}
|
15
|
-
|
16
|
-
h1 {
|
17
|
-
font-size: 28px;
|
18
|
-
color: #000;
|
19
|
-
}
|
20
|
-
|
21
|
-
a {color: #03c}
|
22
|
-
a:hover {
|
23
|
-
background-color: #03c;
|
24
|
-
color: white;
|
25
|
-
text-decoration: none;
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
#page {
|
30
|
-
background-color: #f0f0f0;
|
31
|
-
width: 750px;
|
32
|
-
margin: 0;
|
33
|
-
margin-left: auto;
|
34
|
-
margin-right: auto;
|
35
|
-
}
|
36
|
-
|
37
|
-
#content {
|
38
|
-
float: left;
|
39
|
-
background-color: white;
|
40
|
-
border: 3px solid #aaa;
|
41
|
-
border-top: none;
|
42
|
-
padding: 25px;
|
43
|
-
width: 500px;
|
44
|
-
}
|
45
|
-
|
46
|
-
#sidebar {
|
47
|
-
float: right;
|
48
|
-
width: 175px;
|
49
|
-
}
|
50
|
-
|
51
|
-
#footer {
|
52
|
-
clear: both;
|
53
|
-
}
|
54
|
-
|
55
|
-
#header, #about, #getting-started {
|
56
|
-
padding-left: 75px;
|
57
|
-
padding-right: 30px;
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
#header {
|
62
|
-
background-image: url("/assets/rails.png");
|
63
|
-
background-repeat: no-repeat;
|
64
|
-
background-position: top left;
|
65
|
-
height: 64px;
|
66
|
-
}
|
67
|
-
#header h1, #header h2 {margin: 0}
|
68
|
-
#header h2 {
|
69
|
-
color: #888;
|
70
|
-
font-weight: normal;
|
71
|
-
font-size: 16px;
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
#about h3 {
|
76
|
-
margin: 0;
|
77
|
-
margin-bottom: 10px;
|
78
|
-
font-size: 14px;
|
79
|
-
}
|
80
|
-
|
81
|
-
#about-content {
|
82
|
-
background-color: #ffd;
|
83
|
-
border: 1px solid #fc0;
|
84
|
-
margin-left: -55px;
|
85
|
-
margin-right: -10px;
|
86
|
-
}
|
87
|
-
#about-content table {
|
88
|
-
margin-top: 10px;
|
89
|
-
margin-bottom: 10px;
|
90
|
-
font-size: 11px;
|
91
|
-
border-collapse: collapse;
|
92
|
-
}
|
93
|
-
#about-content td {
|
94
|
-
padding: 10px;
|
95
|
-
padding-top: 3px;
|
96
|
-
padding-bottom: 3px;
|
97
|
-
}
|
98
|
-
#about-content td.name {color: #555}
|
99
|
-
#about-content td.value {color: #000}
|
100
|
-
|
101
|
-
#about-content ul {
|
102
|
-
padding: 0;
|
103
|
-
list-style-type: none;
|
104
|
-
}
|
105
|
-
|
106
|
-
#about-content.failure {
|
107
|
-
background-color: #fcc;
|
108
|
-
border: 1px solid #f00;
|
109
|
-
}
|
110
|
-
#about-content.failure p {
|
111
|
-
margin: 0;
|
112
|
-
padding: 10px;
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
#getting-started {
|
117
|
-
border-top: 1px solid #ccc;
|
118
|
-
margin-top: 25px;
|
119
|
-
padding-top: 15px;
|
120
|
-
}
|
121
|
-
#getting-started h1 {
|
122
|
-
margin: 0;
|
123
|
-
font-size: 20px;
|
124
|
-
}
|
125
|
-
#getting-started h2 {
|
126
|
-
margin: 0;
|
127
|
-
font-size: 14px;
|
128
|
-
font-weight: normal;
|
129
|
-
color: #333;
|
130
|
-
margin-bottom: 25px;
|
131
|
-
}
|
132
|
-
#getting-started ol {
|
133
|
-
margin-left: 0;
|
134
|
-
padding-left: 0;
|
135
|
-
}
|
136
|
-
#getting-started li {
|
137
|
-
font-size: 18px;
|
138
|
-
color: #888;
|
139
|
-
margin-bottom: 25px;
|
140
|
-
}
|
141
|
-
#getting-started li h2 {
|
142
|
-
margin: 0;
|
143
|
-
font-weight: normal;
|
144
|
-
font-size: 18px;
|
145
|
-
color: #333;
|
146
|
-
}
|
147
|
-
#getting-started li p {
|
148
|
-
color: #555;
|
149
|
-
font-size: 13px;
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
#sidebar ul {
|
154
|
-
margin-left: 0;
|
155
|
-
padding-left: 0;
|
156
|
-
}
|
157
|
-
#sidebar ul h3 {
|
158
|
-
margin-top: 25px;
|
159
|
-
font-size: 16px;
|
160
|
-
padding-bottom: 10px;
|
161
|
-
border-bottom: 1px solid #ccc;
|
162
|
-
}
|
163
|
-
#sidebar li {
|
164
|
-
list-style-type: none;
|
165
|
-
}
|
166
|
-
#sidebar ul.links li {
|
167
|
-
margin-bottom: 5px;
|
168
|
-
}
|
169
|
-
|
170
|
-
.filename {
|
171
|
-
font-style: italic;
|
172
|
-
}
|
173
|
-
</style>
|
174
|
-
<script type="text/javascript">
|
175
|
-
function about() {
|
176
|
-
info = document.getElementById('about-content');
|
177
|
-
if (window.XMLHttpRequest)
|
178
|
-
{ xhr = new XMLHttpRequest(); }
|
179
|
-
else
|
180
|
-
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
|
181
|
-
xhr.open("GET","rails/info/properties",false);
|
182
|
-
xhr.send("");
|
183
|
-
info.innerHTML = xhr.responseText;
|
184
|
-
info.style.display = 'block'
|
185
|
-
}
|
186
|
-
</script>
|
187
|
-
</head>
|
188
|
-
<body>
|
189
|
-
<div id="page">
|
190
|
-
<div id="sidebar">
|
191
|
-
<ul id="sidebar-items">
|
192
|
-
<li>
|
193
|
-
<h3>Browse the documentation</h3>
|
194
|
-
<ul class="links">
|
195
|
-
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
|
196
|
-
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
197
|
-
<li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
|
198
|
-
<li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
|
199
|
-
</ul>
|
200
|
-
</li>
|
201
|
-
</ul>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div id="content">
|
205
|
-
<div id="header">
|
206
|
-
<h1>Welcome aboard</h1>
|
207
|
-
<h2>You’re riding Ruby on Rails!</h2>
|
208
|
-
</div>
|
209
|
-
|
210
|
-
<div id="about">
|
211
|
-
<h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3>
|
212
|
-
<div id="about-content" style="display: none"></div>
|
213
|
-
</div>
|
214
|
-
|
215
|
-
<div id="getting-started">
|
216
|
-
<h1>Getting started</h1>
|
217
|
-
<h2>Here’s how to get rolling:</h2>
|
218
|
-
|
219
|
-
<ol>
|
220
|
-
<li>
|
221
|
-
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
|
222
|
-
<p>To see all available options, run it without parameters.</p>
|
223
|
-
</li>
|
224
|
-
|
225
|
-
<li>
|
226
|
-
<h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
|
227
|
-
<p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
|
228
|
-
</li>
|
229
|
-
|
230
|
-
<li>
|
231
|
-
<h2>Create your database</h2>
|
232
|
-
<p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
|
233
|
-
</li>
|
234
|
-
</ol>
|
235
|
-
</div>
|
236
|
-
</div>
|
237
|
-
|
238
|
-
<div id="footer"> </div>
|
239
|
-
</div>
|
240
|
-
</body>
|
241
|
-
</html>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
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('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
data/test_old/sass_rails_test.rb
DELETED
@@ -1,203 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class SassCRailsTest < SassC::Rails::TestCase
|
4
|
-
test 'classes are loaded' do
|
5
|
-
assert_kind_of Module, SassC::Rails
|
6
|
-
assert_kind_of Class, SassC::Rails::Railtie
|
7
|
-
end
|
8
|
-
|
9
|
-
test 'style config item is honored in development mode' do
|
10
|
-
within_rails_app 'alternate_config_project' do
|
11
|
-
runner 'development' do
|
12
|
-
"puts Rails.application.config.sass.style"
|
13
|
-
end
|
14
|
-
|
15
|
-
assert_output /compact/
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
test 'style config item is not honored if environment is not development' do
|
20
|
-
within_rails_app 'alternate_config_project' do
|
21
|
-
runner 'production' do
|
22
|
-
"p Rails.application.config.sass.style"
|
23
|
-
end
|
24
|
-
|
25
|
-
assert_equal 'nil', $last_output.chomp
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
test 'css_compressor config item is not honored in development mode' do
|
30
|
-
within_rails_app 'alternate_config_project' do
|
31
|
-
runner 'development' do
|
32
|
-
"p Rails.application.config.assets.css_compressor"
|
33
|
-
end
|
34
|
-
|
35
|
-
assert_equal 'nil', $last_output.chomp
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
test 'css_compressor config item is honored if environment is not development' do
|
40
|
-
within_rails_app 'alternate_config_project' do
|
41
|
-
runner 'production' do
|
42
|
-
"puts Rails.application.config.assets.css_compressor"
|
43
|
-
end
|
44
|
-
|
45
|
-
assert_output /yui/
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
test 'sass uses expanded style by default in development mode' do
|
50
|
-
within_rails_app 'scss_project' do
|
51
|
-
runner 'development' do
|
52
|
-
"puts Rails.application.config.sass.style"
|
53
|
-
end
|
54
|
-
|
55
|
-
assert_output /expanded/
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
test 'sass not defines compressor in development mode' do
|
60
|
-
within_rails_app 'scss_project' do
|
61
|
-
runner 'development' do
|
62
|
-
"p Rails.application.config.assets.css_compressor"
|
63
|
-
end
|
64
|
-
|
65
|
-
assert_equal 'nil', $last_output.chomp
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
test 'sass defines compressor by default in test mode' do
|
70
|
-
within_rails_app 'scss_project' do
|
71
|
-
runner 'test' do
|
72
|
-
"puts Rails.application.config.assets.css_compressor"
|
73
|
-
end
|
74
|
-
|
75
|
-
assert_equal 'sass', $last_output.chomp
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
test 'sass defines compressor by default in production mode' do
|
80
|
-
within_rails_app 'scss_project' do
|
81
|
-
runner 'production' do
|
82
|
-
"puts Rails.application.config.assets.css_compressor"
|
83
|
-
end
|
84
|
-
|
85
|
-
assert_equal 'sass', $last_output.chomp
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
test 'sprockets require works correctly' do
|
90
|
-
skip
|
91
|
-
|
92
|
-
within_rails_app('scss_project') do |app_root|
|
93
|
-
css_output = asset_output('css_application.css')
|
94
|
-
assert_match /globbed/, css_output
|
95
|
-
|
96
|
-
if File.exists?("#{app_root}/log/development.log")
|
97
|
-
log_file = "#{app_root}/log/development.log"
|
98
|
-
elsif File.exists?("#{app_root}/log/test.log")
|
99
|
-
log_file = "#{app_root}/log/test.log"
|
100
|
-
else
|
101
|
-
flunk "log file was not created"
|
102
|
-
end
|
103
|
-
|
104
|
-
log_output = File.open(log_file).read
|
105
|
-
refute_match /Warning/, log_output
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
test 'sass imports work correctly' do
|
110
|
-
skip
|
111
|
-
|
112
|
-
css_output = sprockets_render('scss_project', 'application.scss')
|
113
|
-
assert_match /main/, css_output
|
114
|
-
assert_match /top-level/, css_output
|
115
|
-
assert_match /partial-sass/, css_output
|
116
|
-
assert_match /partial-scss/, css_output
|
117
|
-
assert_match /sub-folder-relative-sass/, css_output
|
118
|
-
assert_match /sub-folder-relative-scss/, css_output
|
119
|
-
assert_match /not-a-partial/, css_output
|
120
|
-
assert_match /globbed/, css_output
|
121
|
-
assert_match /nested-glob/, css_output
|
122
|
-
assert_match /plain-old-css/, css_output
|
123
|
-
assert_match /another-plain-old-css/, css_output
|
124
|
-
assert_match /without-css-ext/, css_output
|
125
|
-
assert_match /css-erb-handler/, css_output
|
126
|
-
assert_match /scss-erb-handler/, css_output
|
127
|
-
assert_match /sass-erb-handler/, css_output
|
128
|
-
assert_match /css-sass-erb-handler/, css_output
|
129
|
-
assert_match /css-scss-erb-handler/, css_output
|
130
|
-
assert_match /default-old-css/, css_output
|
131
|
-
end
|
132
|
-
|
133
|
-
test 'sprockets directives are ignored within an import' do
|
134
|
-
skip
|
135
|
-
|
136
|
-
css_output = sprockets_render('scss_project', 'import_css_application.css')
|
137
|
-
assert_match /\.css-application/, css_output
|
138
|
-
assert_match /\.import-css-application/, css_output
|
139
|
-
end
|
140
|
-
|
141
|
-
test 'globbed imports work when new file is added' do
|
142
|
-
skip
|
143
|
-
|
144
|
-
project = 'scss_project'
|
145
|
-
filename = 'application.scss'
|
146
|
-
|
147
|
-
within_rails_app(project) do |tmpdir|
|
148
|
-
asset_output(filename)
|
149
|
-
|
150
|
-
new_file = File.join(tmpdir, 'app', 'assets', 'stylesheets', 'globbed', 'new.scss')
|
151
|
-
File.open(new_file, 'w') do |file|
|
152
|
-
file.puts '.new-file-test { color: #000; }'
|
153
|
-
end
|
154
|
-
|
155
|
-
css_output = asset_output(filename)
|
156
|
-
assert_match /new-file-test/, css_output
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
test 'globbed imports work when globbed file is changed' do
|
161
|
-
skip
|
162
|
-
|
163
|
-
project = 'scss_project'
|
164
|
-
filename = 'application.scss'
|
165
|
-
|
166
|
-
within_rails_app(project) do |tmpdir|
|
167
|
-
asset_output(filename)
|
168
|
-
|
169
|
-
new_file = File.join(tmpdir, 'app', 'assets', 'stylesheets', 'globbed', 'globbed.scss')
|
170
|
-
File.open(new_file, 'w') do |file|
|
171
|
-
file.puts '.changed-file-test { color: #000; }'
|
172
|
-
end
|
173
|
-
|
174
|
-
css_output = asset_output(filename)
|
175
|
-
assert_match /changed-file-test/, css_output
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
test 'sass asset paths work' do
|
180
|
-
css_output = sprockets_render('scss_project', 'application.scss')
|
181
|
-
assert_match %r{asset-path:\s*"/assets/rails.png"}, css_output, 'asset-path:\s*"/assets/rails.png"'
|
182
|
-
assert_match %r{asset-url:\s*url\(/assets/rails.png\)}, css_output, 'asset-url:\s*url\(/assets/rails.png\)'
|
183
|
-
assert_match %r{image-path:\s*"/assets/rails.png"}, css_output, 'image-path:\s*"/assets/rails.png"'
|
184
|
-
assert_match %r{image-url:\s*url\(/assets/rails.png\)}, css_output, 'image-url:\s*url\(/assets/rails.png\)'
|
185
|
-
assert_match %r{video-path:\s*"/videos/rails.mp4"}, css_output, 'video-path:\s*"/videos/rails.mp4"'
|
186
|
-
assert_match %r{video-url:\s*url\(/videos/rails.mp4\)}, css_output, 'video-url:\s*url\(/videos/rails.mp4\)'
|
187
|
-
assert_match %r{audio-path:\s*"/audios/rails.mp3"}, css_output, 'audio-path:\s*"/audios/rails.mp3"'
|
188
|
-
assert_match %r{audio-url:\s*url\(/audios/rails.mp3\)}, css_output, 'audio-url:\s*url\(/audios/rails.mp3\)'
|
189
|
-
assert_match %r{font-path:\s*"/fonts/rails.ttf"}, css_output, 'font-path:\s*"/fonts/rails.ttf"'
|
190
|
-
assert_match %r{font-url:\s*url\(/fonts/rails.ttf\)}, css_output, 'font-url:\s*url\(/fonts/rails.ttf\)'
|
191
|
-
assert_match %r{font-url-with-query-hash:\s*url\(/fonts/rails.ttf\?#iefix\)}, css_output, 'font-url:\s*url\(/fonts/rails.ttf?#iefix\)'
|
192
|
-
assert_match %r{javascript-path:\s*"/javascripts/rails.js"}, css_output, 'javascript-path:\s*"/javascripts/rails.js"'
|
193
|
-
assert_match %r{javascript-url:\s*url\(/javascripts/rails.js\)}, css_output, 'javascript-url:\s*url\(/javascripts/rails.js\)'
|
194
|
-
assert_match %r{stylesheet-path:\s*"/stylesheets/rails.css"}, css_output, 'stylesheet-path:\s*"/stylesheets/rails.css"'
|
195
|
-
assert_match %r{stylesheet-url:\s*url\(/stylesheets/rails.css\)}, css_output, 'stylesheet-url:\s*url\(/stylesheets/rails.css\)'
|
196
|
-
|
197
|
-
asset_data_url_regexp = %r{asset-data-url:\s*url\((.*?)\)}
|
198
|
-
assert_match asset_data_url_regexp, css_output, 'asset-data-url:\s*url\((.*?)\)'
|
199
|
-
asset_data_url_match = css_output.match(asset_data_url_regexp)[1]
|
200
|
-
asset_data_url_expected = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCNzY5NDE1QkQ2NkMxMUUwOUUzM0E5Q0E2RTgyQUExQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCNzY5NDE1Q0Q2NkMxMUUwOUUzM0E5Q0E2RTgyQUExQiI%2BIDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MzcyNTQ2RDY2QjExRTA5RTMzQTlDQTZFODJBQTFCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkI3Njk0MTVBRDY2QzExRTA5RTMzQTlDQTZFODJBQTFCIi8%2BIDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY%2BIDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8%2B0HhJ9AAAABBJREFUeNpi%2BP%2F%2FPwNAgAEACPwC%2FtuiTRYAAAAASUVORK5CYII%3D'
|
201
|
-
assert_equal asset_data_url_expected, asset_data_url_match
|
202
|
-
end
|
203
|
-
end
|
@@ -1,181 +0,0 @@
|
|
1
|
-
unless defined?(Bundler)
|
2
|
-
$stderr.puts "You didn't run bundle exec did you? Try again: bundle exec rake test"
|
3
|
-
exit 1
|
4
|
-
end
|
5
|
-
require 'fileutils'
|
6
|
-
require 'tmpdir'
|
7
|
-
|
8
|
-
class SassC::Rails::TestCase < ActiveSupport::TestCase
|
9
|
-
|
10
|
-
class ExecutionError < StandardError
|
11
|
-
attr_accessor :output
|
12
|
-
|
13
|
-
def initialize(message, output = nil)
|
14
|
-
super(message)
|
15
|
-
self.output = output
|
16
|
-
end
|
17
|
-
|
18
|
-
def message
|
19
|
-
"#{super}\nOutput was:\n#{output}"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
module SilentError
|
24
|
-
attr_accessor :output
|
25
|
-
|
26
|
-
def message
|
27
|
-
"#{super}\nOutput was:\n#{output}"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
protected
|
32
|
-
|
33
|
-
def fixture_path(path)
|
34
|
-
File.expand_path("../../fixtures/#{path}", __FILE__)
|
35
|
-
end
|
36
|
-
|
37
|
-
module TestAssetPaths
|
38
|
-
attr_accessor :assets
|
39
|
-
end
|
40
|
-
|
41
|
-
def sprockets_render(project, filename)
|
42
|
-
within_rails_app(project) do
|
43
|
-
asset_output(filename)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def asset_output(filename)
|
48
|
-
runcmd "ruby script/rails runner 'puts Rails.application.assets[#{filename.inspect}]'"
|
49
|
-
end
|
50
|
-
|
51
|
-
def assert_file_exists(filename)
|
52
|
-
assert File.exists?(filename), "could not find #{filename}. PWD=#{Dir.pwd}\nDid find: #{Dir.glob(File.dirname(filename)+"/*").join(", ")}"
|
53
|
-
end
|
54
|
-
|
55
|
-
def assert_not_output(match)
|
56
|
-
assert_no_match match, $last_output
|
57
|
-
end
|
58
|
-
|
59
|
-
def assert_output(match)
|
60
|
-
assert $last_output.to_s =~ match, "#{match} was not found in #{$last_output.inspect}"
|
61
|
-
end
|
62
|
-
|
63
|
-
def assert_line_count(count)
|
64
|
-
last_count = $last_output.lines.count
|
65
|
-
assert last_count == count, "Wrong line count, expected: #{count} but got: #{last_count}"
|
66
|
-
end
|
67
|
-
# Copies a rails app fixture to a temp directory
|
68
|
-
# and changes to that directory during the yield.
|
69
|
-
#
|
70
|
-
# Automatically changes back to the working directory
|
71
|
-
# and removes the temp directory when done.
|
72
|
-
def within_rails_app(name, without_gems = [], gem_options = $gem_options)
|
73
|
-
sourcedir = File.expand_path("../../fixtures/#{name}", __FILE__)
|
74
|
-
|
75
|
-
Dir.mktmpdir do |tmpdir|
|
76
|
-
FileUtils.cp_r "#{sourcedir}/.", tmpdir
|
77
|
-
|
78
|
-
Dir.chdir(tmpdir) do
|
79
|
-
gem_options.each { |gem_name, options| modify_gem_entry gem_name, options }
|
80
|
-
without_gems.each { |gem_name| remove_gem name }
|
81
|
-
|
82
|
-
yield tmpdir
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def process_gemfile(gemfile = "Gemfile", &blk)
|
88
|
-
gem_contents = File.readlines(gemfile)
|
89
|
-
gem_contents.map!(&blk)
|
90
|
-
gem_contents.compact!
|
91
|
-
|
92
|
-
File.open(gemfile, "w") do |f|
|
93
|
-
f.print(gem_contents.join(""))
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def modify_gem_entry(gemname, options, gemfile = "Gemfile")
|
98
|
-
found = false
|
99
|
-
|
100
|
-
process_gemfile(gemfile) do |line|
|
101
|
-
if line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
|
102
|
-
found = true
|
103
|
-
gem_entry(gemname, options) + "\n"
|
104
|
-
else
|
105
|
-
line
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
unless found
|
110
|
-
File.open(gemfile, "a") do |f|
|
111
|
-
f.print("\n#{gem_entry(gemname, options)}\n")
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
def gem_entry(gemname, options)
|
117
|
-
entry = %Q{gem "#{gemname}", "~> #{options[:version]}"}
|
118
|
-
entry += ", :path => #{options[:path].inspect}" if options[:path]
|
119
|
-
entry
|
120
|
-
end
|
121
|
-
|
122
|
-
def remove_gem(gemname)
|
123
|
-
process_gemfile(gemfile) do |line|
|
124
|
-
line unless line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
def silently
|
129
|
-
output = StringIO.new
|
130
|
-
$stderr, old_stderr = output, $stderr
|
131
|
-
$stdout, old_stdout = output, $stdout
|
132
|
-
|
133
|
-
begin
|
134
|
-
yield
|
135
|
-
rescue ExecutionError => e
|
136
|
-
raise
|
137
|
-
rescue => e
|
138
|
-
e.extend(SilentError)
|
139
|
-
e.output = output.string
|
140
|
-
raise
|
141
|
-
end
|
142
|
-
ensure
|
143
|
-
$stderr = old_stderr
|
144
|
-
$stdout = old_stdout
|
145
|
-
end
|
146
|
-
|
147
|
-
# executes a system command
|
148
|
-
# raises an error if it does not complete successfully
|
149
|
-
# returns the output as a string if it does complete successfully
|
150
|
-
def runcmd(cmd, working_directory = Dir.pwd, clean_env = true, gemfile = "Gemfile", env = {})
|
151
|
-
# There's a bug in bundler where with_clean_env doesn't clear out the BUNDLE_GEMFILE environment setting
|
152
|
-
# https://github.com/carlhuda/bundler/issues/1133
|
153
|
-
env["BUNDLE_GEMFILE"] = "#{working_directory}/#{gemfile}" if clean_env
|
154
|
-
|
155
|
-
todo = Proc.new do
|
156
|
-
r, w = IO.pipe
|
157
|
-
Kernel.spawn(env, cmd, :out => w , :err => w, :chdir => working_directory)
|
158
|
-
w.close
|
159
|
-
Process.wait
|
160
|
-
output = r.read
|
161
|
-
r.close
|
162
|
-
|
163
|
-
unless $?.exitstatus == 0
|
164
|
-
raise ExecutionError, "Command failed with exit status #{$?.exitstatus}: #{cmd}", output
|
165
|
-
end
|
166
|
-
|
167
|
-
$last_output = output
|
168
|
-
end
|
169
|
-
|
170
|
-
if clean_env
|
171
|
-
Bundler.with_clean_env(&todo)
|
172
|
-
else
|
173
|
-
todo.call
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
# A thin wrapper around runcmd to be DRY in tests
|
178
|
-
def runner(environment)
|
179
|
-
runcmd "ruby script/rails runner '#{yield}'", Dir.pwd, true, 'Gemfile', {'RAILS_ENV' => environment}
|
180
|
-
end
|
181
|
-
end
|
data/test_old/test_helper.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# Configure Rails Envinronment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require 'bundler/setup'
|
5
|
-
require 'rails'
|
6
|
-
require 'rails/test_help'
|
7
|
-
require 'sassc/rails'
|
8
|
-
|
9
|
-
Rails.backtrace_cleaner.remove_silencers!
|
10
|
-
|
11
|
-
# If developing against local dependencies, this code will ensure they get picked up
|
12
|
-
# in the project fixtures that have their own bundle environment
|
13
|
-
$gem_options = {}
|
14
|
-
possible_dev_dependencies = %w(sassc-rails sassc rails actionpack railties sprockets journey sprockets-rails activerecord-deprecated_finders pry-rails)
|
15
|
-
Bundler.load.specs.each do |s|
|
16
|
-
if possible_dev_dependencies.include?(s.name)
|
17
|
-
gem_path = s.full_gem_path
|
18
|
-
gem_options = { version: s.version}
|
19
|
-
gem_options[:path] = gem_path if File.exists?("#{gem_path}/#{s.name}.gemspec")
|
20
|
-
$gem_options[s.name] = gem_options
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# Load support files
|
25
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
26
|
-
|
27
|
-
ActiveSupport::TestCase.test_order = :random if ActiveSupport::TestCase.respond_to?(:test_order=)
|