moment-timezonejs-rails 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +4 -0
  4. data/lib/moment-timezonejs-rails.rb +10 -0
  5. data/lib/moment/timezonejs/rails/version.rb +7 -0
  6. data/test/dummy/Rakefile +7 -0
  7. data/test/dummy/config.ru +4 -0
  8. data/test/dummy/config/application.rb +64 -0
  9. data/test/dummy/config/boot.rb +10 -0
  10. data/test/dummy/config/environment.rb +5 -0
  11. data/test/dummy/config/environments/development.rb +31 -0
  12. data/test/dummy/config/environments/production.rb +64 -0
  13. data/test/dummy/config/environments/test.rb +35 -0
  14. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  15. data/test/dummy/config/initializers/inflections.rb +15 -0
  16. data/test/dummy/config/initializers/mime_types.rb +5 -0
  17. data/test/dummy/config/initializers/secret_token.rb +7 -0
  18. data/test/dummy/config/initializers/session_store.rb +8 -0
  19. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  20. data/test/dummy/config/locales/en.yml +5 -0
  21. data/test/dummy/config/routes.rb +2 -0
  22. data/test/dummy/log/test.log +19 -0
  23. data/test/dummy/tmp/cache/assets/C77/D70/sprockets%2F872b1621485a6656de327007baf54b14 +0 -0
  24. data/test/dummy/tmp/cache/assets/CF8/1C0/sprockets%2F0f8072dc4ae02f6433841f4031a3ec3b +0 -0
  25. data/test/dummy/tmp/cache/assets/DAE/E00/sprockets%2F27d4f79ef946a8265af7ce6bcb5cd602 +0 -0
  26. data/test/integration/navigation_test.rb +18 -0
  27. data/test/moment-timezonejs-rails_test.rb +7 -0
  28. data/test/test_helper.rb +15 -0
  29. data/vendor/assets/javascripts/moment-timezone-data/links.js +289 -0
  30. data/vendor/assets/javascripts/moment-timezone-data/meta.js +2214 -0
  31. data/vendor/assets/javascripts/moment-timezone-data/rules-since-2000.js +651 -0
  32. data/vendor/assets/javascripts/moment-timezone-data/rules.js +2234 -0
  33. data/vendor/assets/javascripts/moment-timezone-data/zones.js +2979 -0
  34. data/vendor/assets/javascripts/moment-timezone.js +540 -0
  35. metadata +141 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Zjg1OTQ3YjIxMGEyYmI3ZTAwNWNlMWRiOTk0NDI1YjlkYzUwZmE0ZQ==
5
+ data.tar.gz: !binary |-
6
+ MzRlMjZmOWQ4MzlkNTZmM2ZlMjdlZjQxOWQ4MWYyZjczMDYxNWFjMQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MjVlYjlhM2UwY2Y0MWUwY2Q5YjBkY2ExZjliOTczNzNkZWMwOTFiNmQzOTlj
10
+ NjUwNmYxYTM0MWFhOTA5ZGQxYTQ0MzY4YWQ5NzJiMzI1MTkxNTAyMmNkNmNi
11
+ MzNjMWJkMzI2MzYyMDY2Mjg3Y2UyYzFhNmQwMjA5M2Y3ZDU4MjU=
12
+ data.tar.gz: !binary |-
13
+ MzZhMTI2NGRkYTg0NDllMDdhNWYyMjcxMDM3Y2RmNTkzYmY0ODRjMmY0MDE3
14
+ ZGIzOTQwZGNmMzljYTUwYmJmZDJhNzUxODgwNDgwOGUwMmUzN2YxMWY3NGUx
15
+ NmVjM2RhZDhjNDA0MTFiOWU2NzQ4ODUzODRlNWNlNDRhOGE1MWU=
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Damien Brzoska
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ moment-timezonejs-rails
2
+ =======================
3
+
4
+ Moment.js Timezone asset pipeline wrapper
@@ -0,0 +1,10 @@
1
+ require "moment/timezonejs/rails/version"
2
+
3
+ module Moment
4
+ module Timezonejs
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Moment
2
+ module Timezonejs
3
+ module Rails
4
+ VERSION = "0.0.6"
5
+ end
6
+ end
7
+ end
@@ -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,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,64 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ # require "active_record/railtie"
5
+ # require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ # require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require
12
+ require "moment-timezonejs-rails"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable escaping HTML in JSON.
45
+ config.active_support.escape_html_entities_in_json = true
46
+
47
+ # Use SQL instead of Active Record's schema dumper when creating the database.
48
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
49
+ # like if you have constraints or database-specific column types
50
+ # config.active_record.schema_format = :sql
51
+
52
+ # Enforce whitelist mode for mass assignment.
53
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
54
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
55
+ # parameters by using an attr_accessible or attr_protected declaration.
56
+ # config.active_record.whitelist_attributes = true
57
+
58
+ # Enable the asset pipeline
59
+ config.assets.enabled = true
60
+
61
+ # Version of your assets, change this if you want to expire all your assets
62
+ config.assets.version = '1.0'
63
+ end
64
+ end
@@ -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,31 @@
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
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+
26
+ # Do not compress assets
27
+ config.assets.compress = false
28
+
29
+ # Expands the lines which load the assets
30
+ config.assets.debug = true
31
+ end
@@ -0,0 +1,64 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ end
@@ -0,0 +1,35 @@
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
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ 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,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 = '19e4a474ceb4e57f041cf85487c0753f213534e4dbd02f355202aeacc345d57249b44ff1ca2614ee349e42e82b7a83d28749dfd6e5e224394dc63086a650a00b'
@@ -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,9 @@
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
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,19 @@
1
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:23:44 +1000
2
+ Compiled moment-timezone.js (0ms) (pid 31414)
3
+ Served asset /moment-timezone.js - 200 OK (8ms)
4
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:23:44 +1000
5
+ Served asset /moment-timezone.js - 200 OK (0ms)
6
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:25:41 +1000
7
+ Served asset /moment-timezone.js - 200 OK (2ms)
8
+ Started GET "/assets/moment.js" for 127.0.0.1 at 2014-06-12 20:25:41 +1000
9
+ Served asset /moment.js - 404 Not Found (0ms)
10
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:25:41 +1000
11
+ Served asset /moment-timezone.js - 200 OK (0ms)
12
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:25:52 +1000
13
+ Served asset /moment-timezone.js - 200 OK (2ms)
14
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:25:52 +1000
15
+ Served asset /moment-timezone.js - 200 OK (0ms)
16
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:26:21 +1000
17
+ Served asset /moment-timezone.js - 200 OK (2ms)
18
+ Started GET "/assets/moment-timezone.js" for 127.0.0.1 at 2014-06-12 20:26:21 +1000
19
+ Served asset /moment-timezone.js - 200 OK (0ms)
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ test 'can access moment-timezonejs' do
5
+ get '/assets/moment-timezone.js'
6
+ assert_response :success
7
+ end
8
+
9
+ test 'moment-timezonejs response is for the expected version' do
10
+ get 'assets/moment-timezone.js'
11
+ assert_match(/VERSION = "0\.0\.6"/, @response.body)
12
+ end
13
+
14
+ # test 'can access momentjs translation' do
15
+ # get 'assets/moment/fr.js'
16
+ # assert_response :success
17
+ # end
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class MomentTimezonejsRailsTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Moment::Timezonejs::Rails
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end