Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Autoloading compiler and renderers, removing $:.push, making rake tas…

…ks better
  • Loading branch information...
commit 8f26cf5ab4bc29d7e2673f09bf6e2c8237a0483a 1 parent 25e3808
Cameron Dutro authored
View
11 Gemfile
@@ -2,17 +2,6 @@ source :rubygems
gemspec
-group :development do
- gem 'mustache', '~> 0.99.4'
- gem 'ruby_parser', '~> 2.3.1'
-
- platform :ruby do
- gem 'therubyracer', '~> 0.9.10'
- gem 'uglifier', '~> 1.2.4'
- gem 'coffee-script', '~> 2.2.0'
- end
-end
-
group :test do
gem 'rspec', '~> 2.11.0'
gem 'rr', '~> 1.0.4'
View
10 Gemfile.lock
@@ -2,10 +2,15 @@ PATH
remote: .
specs:
twitter_cldr_js (1.0.0)
+ coffee-script (~> 2.2.0)
json (>= 1.1.9)
+ mustache (~> 0.99.4)
railties (~> 3.1)
rake (~> 0.9.2.2)
+ ruby_parser (~> 2.3.1)
+ therubyracer (~> 0.9.10)
twitter_cldr (~> 1.8.0)
+ uglifier (~> 1.2.4)
GEM
remote: http://rubygems.org/
@@ -92,12 +97,7 @@ PLATFORMS
ruby
DEPENDENCIES
- coffee-script (~> 2.2.0)
- mustache (~> 0.99.4)
rcov
rr (~> 1.0.4)
rspec (~> 2.11.0)
- ruby_parser (~> 2.3.1)
- therubyracer (~> 0.9.10)
twitter_cldr_js!
- uglifier (~> 1.2.4)
View
2  Rakefile
@@ -13,7 +13,7 @@ require 'rexml/document'
require 'rspec/core/rake_task'
require 'rubygems/package_task'
-require './lib/twitter_cldr/tasks'
+require './lib/twitter_cldr/js/tasks'
require './lib/twitter_cldr/js'
require 'twitter_cldr'
View
11 lib/twitter_cldr/js.rb
@@ -3,8 +3,6 @@
# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0
-$:.push(File.join(File.dirname(__FILE__), "js"))
-
require 'rails'
require 'twitter_cldr'
require 'mustache'
@@ -12,14 +10,15 @@
require 'uglifier'
require 'coffee-script'
require 'rake'
-require 'twitter_cldr/tasks'
-require 'compiler'
-require 'renderers'
-require 'version'
+require 'twitter_cldr/js/tasks'
+require 'twitter_cldr/js/version'
module TwitterCldr
module Js
+ autoload :Compiler, "twitter_cldr/js/compiler"
+ autoload :Renderers, "twitter_cldr/js/renderers"
+
class Engine < ::Rails::Engine
end
end
View
2  lib/twitter_cldr/tasks.rb → lib/twitter_cldr/js/tasks.rb
@@ -2,7 +2,7 @@
task :update do
build(
:begin_msg => "Updating build... ",
- :output_dir => File.expand_path(File.join(File.dirname(__FILE__), "../assets/javascripts/twitter_cldr")),
+ :output_dir => File.expand_path(File.join(File.dirname(__FILE__), "../../assets/javascripts/twitter_cldr")),
:files => { "twitter_cldr_%s.js" => false }
)
end
View
5 twitter_cldr_js.gemspec
@@ -18,6 +18,11 @@ Gem::Specification.new do |s|
s.add_dependency 'twitter_cldr', '~> 1.8.0'
s.add_dependency 'railties', '~> 3.1'
s.add_dependency 'rake', '~> 0.9.2.2'
+ s.add_dependency 'mustache', '~> 0.99.4'
+ s.add_dependency 'ruby_parser', '~> 2.3.1'
+ s.add_dependency 'therubyracer', '~> 0.9.10'
+ s.add_dependency 'uglifier', '~> 1.2.4'
+ s.add_dependency 'coffee-script', '~> 2.2.0'
s.require_path = 'lib'
Please sign in to comment.
Something went wrong with that request. Please try again.