File: smoke-test

package info (click to toggle)
ruby-bootstrap-switch-rails 3.3.4%2Bdfsg%2BREALLY.3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112 kB
  • sloc: sh: 63; ruby: 35; makefile: 16
file content (81 lines) | stat: -rwxr-xr-x 1,881 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh

exec 2>&1
set -ex

# Create a dummy rails app skeleton
cd $AUTOPKGTEST_TMP
mkdir foo
cd foo
mkdir -p config
mkdir -p app/assets/stylesheets
mkdir -p app/assets/javascripts

# Include the rails asset we want to test
cat >> app/assets/stylesheets/application.scss <<EOF
/* for bootstrap3 */
@import "bootstrap3-switch";
/* or for bootstrap2 */
@import "bootstrap2-switch";
EOF

cat >> app/assets/javascripts/application.js <<EOF
//= require bootstrap-switch
EOF

cat >> Gemfile <<EOF
gem "rake"
gem "railties"
gem 'bootstrap-switch-rails'
gem 'sassc-rails', '>= 2.1'
EOF

bundle install --local

# Copied from rails new foo
cat >> Rakefile <<EOF
require_relative 'config/application'

Rails.logger = Logger.new(STDOUT)
Rails.application.load_tasks
EOF

# Copied from rails new foo
cat >> config/application.rb <<EOF
require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Foo
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 6.0

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration can go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded after loading
    # the framework and any gems in your application.
  end
end
EOF

# Copied from rails new foo
cat >> config/boot.rb <<EOF
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
EOF

# Copied from rails new foo
cat >> config/environment.rb <<EOF
# Load the Rails application.
require_relative 'application'

# Initialize the Rails application.
Rails.application.initialize!
EOF

# Confirm sprockets can find the asset
bundle exec rake assets:precompile