activeadmin 1.0.0.pre4 → 1.0.0.pre5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +3 -3
- data/.travis.yml +48 -26
- data/Appraisals +103 -0
- data/CHANGELOG.md +12 -1
- data/CONTRIBUTING.md +85 -32
- data/Gemfile +13 -38
- data/README.md +10 -26
- data/Rakefile +41 -9
- data/activeadmin.gemspec +7 -4
- data/app/assets/javascripts/active_admin/initializers/filters.js.coffee +10 -3
- data/app/assets/javascripts/active_admin/jquery_ui.js.erb +11 -4
- data/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee +8 -0
- data/app/assets/javascripts/active_admin/lib/modal_dialog.js.coffee +1 -1
- data/app/assets/javascripts/active_admin/lib/per_page.js.coffee +14 -3
- data/app/assets/stylesheets/active_admin/_forms.scss +1 -0
- data/app/views/active_admin/devise/registrations/new.html.erb +1 -1
- data/codecov.yml +23 -0
- data/config/locales/es-MX.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/config/locales/ru.yml +1 -0
- data/config/locales/sk.yml +110 -0
- data/docs/0-installation.md +3 -0
- data/docs/1-general-configuration.md +11 -0
- data/docs/10-custom-pages.md +25 -0
- data/docs/11-decorators.md +3 -0
- data/docs/12-arbre-components.md +3 -0
- data/docs/13-authorization-adapter.md +3 -0
- data/docs/14-gotchas.md +19 -0
- data/docs/2-resource-customization.md +21 -2
- data/docs/3-index-pages.md +21 -0
- data/docs/3-index-pages/custom-index.md +3 -0
- data/docs/3-index-pages/index-as-block.md +3 -0
- data/docs/3-index-pages/index-as-blog.md +3 -0
- data/docs/3-index-pages/index-as-grid.md +3 -0
- data/docs/3-index-pages/index-as-table.md +22 -0
- data/docs/4-csv-format.md +15 -0
- data/docs/5-forms.md +7 -3
- data/docs/6-show-pages.md +3 -0
- data/docs/7-sidebars.md +3 -0
- data/docs/8-custom-actions.md +3 -0
- data/docs/9-batch-actions.md +4 -1
- data/docs/CNAME +1 -0
- data/docs/Gemfile +2 -0
- data/docs/_config.yml +2 -0
- data/docs/_includes/footer.html +8 -0
- data/docs/_includes/google-analytics.html +16 -0
- data/docs/_includes/head.html +7 -0
- data/docs/_includes/toc.html +97 -0
- data/docs/_includes/top-menu.html +9 -0
- data/docs/_layouts/default.html +21 -0
- data/docs/documentation.md +62 -0
- data/docs/images/activeadmin.png +0 -0
- data/docs/images/code-header.png +0 -0
- data/docs/images/divider.png +0 -0
- data/docs/images/features.png +0 -0
- data/docs/index.html +130 -0
- data/docs/stylesheets/main.css +1199 -0
- data/features/action_item.feature +2 -2
- data/features/authorization_cancan.feature +3 -3
- data/features/belongs_to.feature +60 -2
- data/features/comments/commenting.feature +7 -7
- data/features/development_reloading.feature +1 -1
- data/features/edit_page.feature +9 -9
- data/features/footer.feature +28 -0
- data/features/i18n.feature +11 -0
- data/features/index/batch_actions.feature +28 -6
- data/features/index/filters.feature +31 -11
- data/features/index/format_as_csv.feature +13 -13
- data/features/index/formats.feature +4 -4
- data/features/index/index_as_block.feature +1 -1
- data/features/index/index_as_blog.feature +6 -6
- data/features/index/index_as_grid.feature +3 -3
- data/features/index/index_as_table.feature +11 -11
- data/features/index/index_blank_slate.feature +4 -4
- data/features/index/index_parameters.feature +10 -10
- data/features/index/index_scope_to.feature +3 -3
- data/features/index/index_scopes.feature +37 -18
- data/features/index/page_title.feature +3 -3
- data/features/index/pagination.feature +1 -1
- data/features/index/switch_index_view.feature +8 -8
- data/features/menu.feature +3 -3
- data/features/new_page.feature +8 -8
- data/features/registering_assets.feature +1 -1
- data/features/registering_pages.feature +73 -2
- data/features/registering_resources.feature +1 -1
- data/features/renamed_resource.feature +1 -1
- data/features/show/page_title.feature +3 -3
- data/features/sidebar_sections.feature +6 -6
- data/features/specifying_actions.feature +29 -4
- data/features/step_definitions/factory_steps.rb +1 -1
- data/features/step_definitions/footer_steps.rb +11 -0
- data/features/step_definitions/i18n_steps.rb +8 -0
- data/features/step_definitions/index_scope_steps.rb +4 -0
- data/features/step_definitions/sidebar_steps.rb +1 -3
- data/features/step_definitions/table_steps.rb +1 -5
- data/features/step_definitions/user_steps.rb +7 -0
- data/features/support/env.rb +6 -33
- data/features/support/paths.rb +5 -0
- data/features/users/logging_in.feature +2 -0
- data/gemfiles/rails_32.gemfile +54 -0
- data/gemfiles/rails_40.gemfile +53 -0
- data/gemfiles/rails_41.gemfile +53 -0
- data/gemfiles/rails_42.gemfile +53 -0
- data/gemfiles/rails_50.gemfile +46 -0
- data/lib/active_admin.rb +1 -0
- data/lib/active_admin/application.rb +11 -0
- data/lib/active_admin/batch_actions/resource_extension.rb +0 -8
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +1 -1
- data/lib/active_admin/dsl.rb +0 -6
- data/lib/active_admin/filters/active.rb +9 -1
- data/lib/active_admin/filters/formtastic_addons.rb +1 -1
- data/lib/active_admin/filters/humanized.rb +1 -1
- data/lib/active_admin/filters/resource_extension.rb +2 -4
- data/lib/active_admin/form_builder.rb +12 -6
- data/lib/active_admin/helpers/collection.rb +2 -0
- data/lib/active_admin/inputs.rb +1 -0
- data/lib/active_admin/inputs/filters/date_range_input.rb +9 -4
- data/lib/active_admin/inputs/filters/text_input.rb +26 -0
- data/lib/active_admin/localizers.rb +11 -0
- data/lib/active_admin/localizers/resource_localizer.rb +35 -0
- data/lib/active_admin/namespace.rb +1 -1
- data/lib/active_admin/order_clause.rb +29 -7
- data/lib/active_admin/page.rb +18 -4
- data/lib/active_admin/page_dsl.rb +4 -0
- data/lib/active_admin/resource.rb +16 -1
- data/lib/active_admin/resource/action_items.rb +7 -4
- data/lib/active_admin/resource/belongs_to.rb +4 -0
- data/lib/active_admin/resource/menu.rb +1 -1
- data/lib/active_admin/resource/ordering.rb +11 -0
- data/lib/active_admin/resource/routes.rb +34 -13
- data/lib/active_admin/resource/scopes.rb +1 -0
- data/lib/active_admin/resource_controller/data_access.rb +3 -10
- data/lib/active_admin/resource_dsl.rb +28 -1
- data/lib/active_admin/router.rb +5 -3
- data/lib/active_admin/scope.rb +3 -3
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/auto_link_helper.rb +2 -2
- data/lib/active_admin/view_helpers/display_helper.rb +8 -3
- data/lib/active_admin/view_helpers/method_or_proc_helper.rb +5 -1
- data/lib/active_admin/views/components/active_admin_form.rb +11 -10
- data/lib/active_admin/views/components/attributes_table.rb +1 -1
- data/lib/active_admin/views/components/columns.rb +3 -3
- data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
- data/lib/active_admin/views/components/index_list.rb +4 -1
- data/lib/active_admin/views/components/paginated_collection.rb +1 -0
- data/lib/active_admin/views/components/scopes.rb +8 -1
- data/lib/active_admin/views/components/site_title.rb +2 -2
- data/lib/active_admin/views/components/table_for.rb +3 -3
- data/lib/active_admin/views/footer.rb +17 -3
- data/lib/active_admin/views/index_as_table.rb +3 -3
- data/lib/active_admin/views/pages/base.rb +4 -2
- data/lib/active_admin/views/pages/form.rb +2 -3
- data/lib/active_admin/views/pages/show.rb +2 -1
- data/lib/bug_report_templates/rails_5_master.rb +120 -0
- data/lib/generators/active_admin/devise/devise_generator.rb +6 -3
- data/lib/generators/active_admin/install/install_generator.rb +1 -1
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +15 -1
- data/lib/generators/active_admin/install/templates/migrations/{create_active_admin_comments.rb → create_active_admin_comments.rb.erb} +14 -1
- data/lib/ransack_ext.rb +2 -2
- data/spec/bug_report_templates_spec.rb +27 -0
- data/spec/javascripts/support/jasmine_runner.rb +4 -17
- data/spec/rails_helper.rb +20 -109
- data/spec/requests/default_namespace_spec.rb +16 -28
- data/spec/requests/javascript_spec.rb +1 -1
- data/spec/requests/memory_spec.rb +5 -1
- data/spec/requests/stylesheets_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -10
- data/spec/support/active_admin_integration_spec_helper.rb +66 -0
- data/spec/support/active_admin_request_helpers.rb +12 -0
- data/spec/support/rails_template.rb +42 -15
- data/spec/support/rails_template_with_data.rb +24 -5
- data/spec/support/templates/manifest.js +3 -0
- data/spec/support/templates/policies/application_policy.rb +1 -1
- data/spec/unit/abstract_view_factory_spec.rb +1 -1
- data/spec/unit/action_builder_spec.rb +3 -12
- data/spec/unit/active_admin_spec.rb +1 -1
- data/spec/unit/application_spec.rb +5 -1
- data/spec/unit/asset_registration_spec.rb +1 -1
- data/spec/unit/authorization/authorization_adapter_spec.rb +1 -1
- data/spec/unit/authorization/controller_authorization_spec.rb +13 -9
- data/spec/unit/authorization/index_overriding_spec.rb +6 -6
- data/spec/unit/auto_link_spec.rb +48 -24
- data/spec/unit/batch_actions/resource_spec.rb +1 -14
- data/spec/unit/batch_actions/settings_spec.rb +1 -1
- data/spec/unit/belongs_to_spec.rb +9 -1
- data/spec/unit/cancan_adapter_spec.rb +1 -1
- data/spec/unit/comments_spec.rb +26 -19
- data/spec/unit/component_spec.rb +1 -1
- data/spec/unit/config_shared_examples.rb +1 -1
- data/spec/unit/controller_filters_spec.rb +1 -1
- data/spec/unit/csv_builder_spec.rb +5 -5
- data/spec/unit/dependency_spec.rb +1 -1
- data/spec/unit/devise_spec.rb +17 -3
- data/spec/unit/dsl_spec.rb +2 -2
- data/spec/unit/filters/active_spec.rb +21 -0
- data/spec/unit/filters/filter_form_builder_spec.rb +98 -31
- data/spec/unit/filters/humanized_spec.rb +9 -1
- data/spec/unit/filters/resource_spec.rb +5 -4
- data/spec/unit/form_builder_spec.rb +180 -33
- data/spec/unit/generators/install_spec.rb +12 -5
- data/spec/unit/helpers/collection_spec.rb +10 -7
- data/spec/unit/helpers/scope_chain_spec.rb +1 -1
- data/spec/unit/helpers/settings_spec.rb +1 -1
- data/spec/unit/i18n_spec.rb +1 -1
- data/spec/unit/localizers/resource_localizer_spec.rb +36 -0
- data/spec/unit/menu_collection_spec.rb +1 -1
- data/spec/unit/menu_item_spec.rb +1 -1
- data/spec/unit/menu_spec.rb +1 -1
- data/spec/unit/namespace/authorization_spec.rb +1 -1
- data/spec/unit/namespace/register_page_spec.rb +28 -2
- data/spec/unit/namespace/register_resource_spec.rb +3 -1
- data/spec/unit/namespace_spec.rb +23 -1
- data/spec/unit/order_clause_spec.rb +7 -7
- data/spec/unit/page_controller_spec.rb +1 -1
- data/spec/unit/page_spec.rb +55 -2
- data/spec/unit/pretty_format_spec.rb +8 -7
- data/spec/unit/pundit_adapter_spec.rb +1 -1
- data/spec/unit/resource/action_items_spec.rb +1 -1
- data/spec/unit/resource/includes_spec.rb +1 -1
- data/spec/unit/resource/menu_spec.rb +1 -1
- data/spec/unit/resource/naming_spec.rb +1 -1
- data/spec/unit/resource/ordering_spec.rb +38 -0
- data/spec/unit/resource/page_presenters_spec.rb +1 -1
- data/spec/unit/resource/pagination_spec.rb +1 -1
- data/spec/unit/resource/routes_spec.rb +101 -53
- data/spec/unit/resource/scopes_spec.rb +1 -1
- data/spec/unit/resource/sidebars_spec.rb +1 -1
- data/spec/unit/resource_collection_spec.rb +1 -1
- data/spec/unit/resource_controller/data_access_spec.rb +50 -1
- data/spec/unit/resource_controller/decorators_spec.rb +2 -2
- data/spec/unit/resource_controller/sidebars_spec.rb +16 -17
- data/spec/unit/resource_controller_spec.rb +50 -56
- data/spec/unit/resource_registration_spec.rb +9 -4
- data/spec/unit/resource_spec.rb +9 -1
- data/spec/unit/routing_spec.rb +30 -2
- data/spec/unit/scope_spec.rb +26 -2
- data/spec/unit/settings_spec.rb +2 -2
- data/spec/unit/view_factory_spec.rb +1 -1
- data/spec/unit/view_helpers/breadcrumbs_spec.rb +1 -1
- data/spec/unit/view_helpers/display_helper_spec.rb +18 -3
- data/spec/unit/view_helpers/download_format_links_helper_spec.rb +1 -1
- data/spec/unit/view_helpers/fields_for_spec.rb +1 -1
- data/spec/unit/view_helpers/flash_helper_spec.rb +1 -1
- data/spec/unit/view_helpers/form_helper_spec.rb +1 -1
- data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +1 -1
- data/spec/unit/views/components/attributes_table_spec.rb +1 -1
- data/spec/unit/views/components/batch_action_selector_spec.rb +1 -1
- data/spec/unit/views/components/blank_slate_spec.rb +1 -1
- data/spec/unit/views/components/columns_spec.rb +1 -1
- data/spec/unit/views/components/index_list_spec.rb +18 -4
- data/spec/unit/views/components/index_table_for_spec.rb +1 -1
- data/spec/unit/views/components/paginated_collection_spec.rb +1 -1
- data/spec/unit/views/components/panel_spec.rb +1 -1
- data/spec/unit/views/components/sidebar_section_spec.rb +1 -1
- data/spec/unit/views/components/site_title_spec.rb +1 -1
- data/spec/unit/views/components/status_tag_spec.rb +1 -1
- data/spec/unit/views/components/table_for_spec.rb +9 -7
- data/spec/unit/views/components/tabs_spec.rb +1 -1
- data/spec/unit/views/components/unsupported_browser_spec.rb +3 -3
- data/spec/unit/views/index_as_blog_spec.rb +1 -1
- data/spec/unit/views/pages/form_spec.rb +1 -1
- data/spec/unit/views/pages/index_spec.rb +1 -1
- data/spec/unit/views/pages/layout_spec.rb +1 -1
- data/spec/unit/views/pages/show_spec.rb +1 -1
- data/spec/unit/views/tabbed_navigation_spec.rb +2 -2
- data/tasks/local.rake +25 -0
- data/tasks/parallel_tests.rake +4 -4
- data/tasks/test.rake +8 -53
- metadata +61 -18
- data/Guardfile +0 -8
- data/script/local +0 -53
- data/script/travis_cache +0 -107
- data/script/use_rails +0 -53
- data/spec/javascripts/support/jasmine_config.rb +0 -23
- data/spec/support/detect_rails_version.rb +0 -34
data/Guardfile
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
# More info at https://github.com/guard/guard#readme
|
2
|
-
|
3
|
-
guard 'rspec', :all_on_start => false, :version => 2 do
|
4
|
-
watch(%r{^spec/.+_spec\.rb$})
|
5
|
-
watch(%r{^lib/active_admin/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
6
|
-
watch('spec/spec_helper.rb') { "spec/" }
|
7
|
-
watch('spec/rails_helper.rb') { "spec/" }
|
8
|
-
end
|
data/script/local
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'shellwords'
|
4
|
-
require File.expand_path('../../spec/support/detect_rails_version', __FILE__)
|
5
|
-
|
6
|
-
unless ARGV[0]
|
7
|
-
puts <<-EOF
|
8
|
-
Usage: ./script/#{__FILE__} COMMAND [ARGS]
|
9
|
-
|
10
|
-
The command will be run in the context of the local rails
|
11
|
-
app stored in test-rails-app.
|
12
|
-
|
13
|
-
Examples:
|
14
|
-
|
15
|
-
./script/local server
|
16
|
-
./script/local c
|
17
|
-
./script/local rake db:migrate
|
18
|
-
EOF
|
19
|
-
exit(1)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Set up some variables
|
23
|
-
rails_version = detect_rails_version!
|
24
|
-
|
25
|
-
dir = ".test-rails-apps"
|
26
|
-
path = "#{dir}/test-rails-app-#{rails_version}"
|
27
|
-
|
28
|
-
# Ensure .test-rails-apps is created
|
29
|
-
system "mkdir #{dir}" unless File.exists?(dir)
|
30
|
-
|
31
|
-
# Create the sample rails app if it doesn't already exist
|
32
|
-
unless File.exists? path
|
33
|
-
args = %w[
|
34
|
-
-m\ spec/support/rails_template_with_data.rb
|
35
|
-
--skip-gemfile
|
36
|
-
--skip-bundle
|
37
|
-
--skip-git
|
38
|
-
--skip-turbolinks
|
39
|
-
--skip-test-unit
|
40
|
-
]
|
41
|
-
system "RAILS='#{rails_version}' bundle exec rails new #{Shellwords.escape path} #{args.join ' '}"
|
42
|
-
end
|
43
|
-
|
44
|
-
# Link this rails app
|
45
|
-
system "rm test-rails-app"
|
46
|
-
system "ln -s #{Shellwords.escape path} test-rails-app"
|
47
|
-
|
48
|
-
# If it's a rails command, auto add the rails script
|
49
|
-
RAILS_COMMANDS = %w{generate console server dbconsole g c s runner}
|
50
|
-
args = RAILS_COMMANDS.include?(ARGV[0]) ? ["rails", ARGV].flatten : ARGV
|
51
|
-
|
52
|
-
# Run the command
|
53
|
-
exec "cd test-rails-app && GEMFILE=../Gemfile bundle exec #{args.join(" ")}"
|
data/script/travis_cache
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'base64'
|
4
|
-
require 'digest'
|
5
|
-
require 'openssl'
|
6
|
-
require 'shellwords'
|
7
|
-
|
8
|
-
prefix = "ruby_#{RUBY_VERSION}-rails_#{ENV.fetch 'RAILS'}-"
|
9
|
-
BUNDLE = prefix + 'bundle'
|
10
|
-
APP = prefix + 'app'
|
11
|
-
|
12
|
-
def download_bundle
|
13
|
-
s3 :save, file: "#{BUNDLE}.sha2", as: "remote-#{BUNDLE}.sha2"
|
14
|
-
s3 :save, file: "#{BUNDLE}.tgz", as: "remote-#{BUNDLE}.tgz", untar: true
|
15
|
-
end
|
16
|
-
|
17
|
-
def download_app
|
18
|
-
# Force test app re-build if dependencies were updated
|
19
|
-
unless digest_changed? 'Gemfile.lock', "remote-#{BUNDLE}.sha2", "#{BUNDLE}.sha2"
|
20
|
-
s3 :save, file: "#{APP}.sha2", as: "remote-#{APP}.sha2"
|
21
|
-
# Force test app re-build if spec/support changed
|
22
|
-
unless digest_changed? 'spec/support', "remote-#{APP}.sha2", "#{APP}.sha2"
|
23
|
-
s3 :save, file: "#{APP}.tgz", as: "remote-#{APP}.tgz", untar: true
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def upload
|
29
|
-
unless ID && SECRET
|
30
|
-
puts "S3 credentials missing"
|
31
|
-
return
|
32
|
-
end
|
33
|
-
|
34
|
-
[ ['Gemfile.lock', BUNDLE, 'bundle'],
|
35
|
-
['spec/support', APP, 'spec/rails']
|
36
|
-
].each do |to_check, name, to_save|
|
37
|
-
puts "=> Checking #{to_check} for changes"
|
38
|
-
if ret = digest_changed?(to_check, "remote-#{name}.sha2", "#{name}.sha2")
|
39
|
-
puts " => Changes found: #{ret[:old]} -> #{ret[:new]}"
|
40
|
-
|
41
|
-
puts " => Creating an archive"
|
42
|
-
`tar -cjf #{name}.tgz #{to_save}`
|
43
|
-
|
44
|
-
puts " => Uploading a new archive"
|
45
|
-
s3 :upload, file: "#{name}.tgz"
|
46
|
-
s3 :upload, file: "#{name}.sha2"
|
47
|
-
else
|
48
|
-
puts " => There were no changes, doing nothing"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def digest_changed?(to_check, old_digest_file, new_digest_file)
|
54
|
-
if File.exists? new_digest_file
|
55
|
-
digest = File.read new_digest_file
|
56
|
-
else
|
57
|
-
# Supports a single file, as well as a folder
|
58
|
-
files = Dir[to_check, "#{to_check}/**/*"].reject{ |f| File.directory? f }
|
59
|
-
content = files.sort!.map{ |f| File.read f }.join
|
60
|
-
digest = Digest::SHA2.hexdigest content
|
61
|
-
File.write new_digest_file, digest
|
62
|
-
end
|
63
|
-
|
64
|
-
old_digest = File.read old_digest_file if File.exists? old_digest_file
|
65
|
-
|
66
|
-
{old: old_digest, new: digest} if digest != old_digest
|
67
|
-
end
|
68
|
-
|
69
|
-
def sign(secret, to_sign)
|
70
|
-
Base64.strict_encode64 OpenSSL::HMAC.digest OpenSSL::Digest::SHA1.new, secret, to_sign
|
71
|
-
end
|
72
|
-
|
73
|
-
ID = ENV['AWS_S3_ID']
|
74
|
-
SECRET = ENV['AWS_S3_SECRET']
|
75
|
-
URL = 'https://s3.amazonaws.com/ActiveAdmin'
|
76
|
-
|
77
|
-
# s3 :list
|
78
|
-
# s3 :upload, file: 'foo'
|
79
|
-
# s3 :find, file: 'foo'
|
80
|
-
# s3 :save, file: 'foo', as: 'bar'
|
81
|
-
# s3 :save, file: 'foo', untar: true
|
82
|
-
def s3(action, options = {})
|
83
|
-
verb = {list: :get, upload: :put, find: :get, save: :get}.fetch action
|
84
|
-
file = options.fetch(:file) unless action == :list
|
85
|
-
extra_arg = case action
|
86
|
-
when :upload then "-T #{file}"
|
87
|
-
when :save then options[:as] ? "-o #{options[:as]}" : '-O'
|
88
|
-
end
|
89
|
-
do_after = "&& tar -xf #{options[:as] || file}" if options[:untar]
|
90
|
-
|
91
|
-
if ID && SECRET
|
92
|
-
now = Time.now.strftime "%a, %d %b %Y %H:%M:%S %z"
|
93
|
-
signature = sign SECRET, "#{verb.upcase}\n\n\n#{now}\n/ActiveAdmin/#{file}"
|
94
|
-
headers = ["Authorization: AWS #{ID}:#{signature}", "Date: #{now}"].map do |h|
|
95
|
-
"-H #{Shellwords.escape h}"
|
96
|
-
end.join ' '
|
97
|
-
end
|
98
|
-
|
99
|
-
output = `curl -f #{headers} #{extra_arg} #{URL}/#{file} #{do_after}`
|
100
|
-
[$?.success?, output]
|
101
|
-
end
|
102
|
-
|
103
|
-
if %w[download_bundle download_app upload].include? ARGV[0]
|
104
|
-
send ARGV[0]
|
105
|
-
else
|
106
|
-
raise "unexpected argument(s): #{ARGV}"
|
107
|
-
end
|
data/script/use_rails
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Switches the development environment to use the given
|
4
|
-
# version of rails. Caches the Gemfile.locks so that
|
5
|
-
# switching it very fast.
|
6
|
-
#
|
7
|
-
require File.expand_path("../../spec/support/detect_rails_version", __FILE__)
|
8
|
-
|
9
|
-
def cmd(command)
|
10
|
-
puts command
|
11
|
-
exit 1 unless system command
|
12
|
-
end
|
13
|
-
|
14
|
-
version = ARGV[0]
|
15
|
-
|
16
|
-
unless version
|
17
|
-
puts "USAGE: ./script/#{__FILE__} VERSION [OPTIONS]"
|
18
|
-
puts
|
19
|
-
puts "Options:"
|
20
|
-
puts " --clobber Add this flag to remove the existing Gemfile.lock before running"
|
21
|
-
exit(1)
|
22
|
-
end
|
23
|
-
|
24
|
-
def file_or_symlink?(path)
|
25
|
-
File.exist?(path) || File.symlink?(path)
|
26
|
-
end
|
27
|
-
|
28
|
-
gem_lock_dir = ".gemfile-locks"
|
29
|
-
gem_lock_file = "#{gem_lock_dir}/Gemfile-#{version}.lock"
|
30
|
-
|
31
|
-
# Ensure our lock dir is created
|
32
|
-
cmd "mkdir #{gem_lock_dir}" unless File.exists?(gem_lock_dir)
|
33
|
-
|
34
|
-
# --clobber passed in
|
35
|
-
if File.exists?(gem_lock_file) && ARGV.include?('--clobber')
|
36
|
-
cmd "rm #{gem_lock_file}"
|
37
|
-
end
|
38
|
-
|
39
|
-
write_rails_version(version)
|
40
|
-
|
41
|
-
# Ensure that bundler installs
|
42
|
-
ENV['RUBYOPT'] = ''
|
43
|
-
|
44
|
-
if File.exists?(gem_lock_file)
|
45
|
-
cmd("rm Gemfile.lock") if file_or_symlink?("Gemfile.lock")
|
46
|
-
cmd("ln -s #{gem_lock_file} Gemfile.lock")
|
47
|
-
cmd("bundle")
|
48
|
-
else
|
49
|
-
cmd "rm Gemfile.lock" if file_or_symlink?("Gemfile.lock")
|
50
|
-
cmd "bundle install"
|
51
|
-
cmd "mv Gemfile.lock #{gem_lock_file}"
|
52
|
-
cmd("ln -s #{gem_lock_file} Gemfile.lock")
|
53
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Jasmine
|
2
|
-
class Config
|
3
|
-
|
4
|
-
# Add your overrides or custom config code here
|
5
|
-
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
# Note - this is necessary for rspec2, which has removed the backtrace
|
11
|
-
module Jasmine
|
12
|
-
class SpecBuilder
|
13
|
-
def declare_spec(parent, spec)
|
14
|
-
me = self
|
15
|
-
example_name = spec["name"]
|
16
|
-
@spec_ids << spec["id"]
|
17
|
-
backtrace = @example_locations[parent.description + " " + example_name]
|
18
|
-
parent.it example_name, {} do
|
19
|
-
me.report_spec(spec["id"])
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# Detects the current version of Rails that is being used
|
2
|
-
#
|
3
|
-
#
|
4
|
-
RAILS_VERSION_FILE ||= File.expand_path("../../../.rails-version", __FILE__)
|
5
|
-
|
6
|
-
unless defined? TRAVIS_CONFIG
|
7
|
-
require 'yaml'
|
8
|
-
filename = File.expand_path("../../../.travis.yml", __FILE__)
|
9
|
-
TRAVIS_CONFIG = YAML.load_file filename
|
10
|
-
TRAVIS_RAILS_VERSIONS = TRAVIS_CONFIG['env']['matrix'].grep(/RAILS=(.*)/){ $1 }.map{ |v| v.delete('"') }
|
11
|
-
end
|
12
|
-
|
13
|
-
DEFAULT_RAILS_VERSION ||= TRAVIS_RAILS_VERSIONS.last
|
14
|
-
|
15
|
-
def detect_rails_version
|
16
|
-
version = version_from_file || ENV['RAILS'] || DEFAULT_RAILS_VERSION
|
17
|
-
ensure
|
18
|
-
puts "Detected Rails: #{version}" if ENV['DEBUG']
|
19
|
-
end
|
20
|
-
|
21
|
-
def detect_rails_version!
|
22
|
-
detect_rails_version or raise "can't find a version of Rails to use!"
|
23
|
-
end
|
24
|
-
|
25
|
-
def version_from_file
|
26
|
-
if File.exists?(RAILS_VERSION_FILE)
|
27
|
-
version = File.read(RAILS_VERSION_FILE).chomp.strip
|
28
|
-
version unless version == ''
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def write_rails_version(version)
|
33
|
-
File.open(RAILS_VERSION_FILE, "w+"){|f| f << version }
|
34
|
-
end
|