trackman 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,7 +14,7 @@ Works out of the box for Ruby(1.8.7 and 1.9.3) on
14
14
  * Deploy the changes and boot your app.
15
15
 
16
16
  ### Need to change your layout or assets?
17
- Simply edit your static pages, link different assets, go crazy!0
17
+ Simply edit your static pages, link different assets, go crazy!
18
18
  Trackman will sync upon application boot on your next deployment.
19
19
 
20
20
  ### Conventions
data/lib/railtie.rb CHANGED
@@ -1,7 +1,5 @@
1
- #Bundler.require
2
-
3
1
  if defined?(Rails)
4
- if ::Rails::VERSION::STRING =~ /^2\.[1-9]/ && Rails.env.production?
2
+ if ::Rails::VERSION::STRING =~ /^2\.[1-9]/
5
3
  module Trackman
6
4
  class RackMiddleware
7
5
  def initialize(app)
@@ -24,11 +22,9 @@ if defined?(Rails)
24
22
  Dir[File.join(File.dirname(__FILE__),'../rails_generators/trackman_tasks/templates/*.rake')].each { |f| load f }
25
23
  end
26
24
 
27
- if Rails.env == "production"
28
- initializer "trackman.hook" do |app|
29
- app.config.after_initialize do
30
- Trackman::Assets::Asset.autosync
31
- end
25
+ initializer "trackman.hook" do |app|
26
+ app.config.after_initialize do
27
+ Trackman::Assets::Asset.autosync
32
28
  end
33
29
  end
34
30
  end
@@ -1,3 +1,3 @@
1
1
  module Trackman
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
data/spec/sync_spec.rb CHANGED
@@ -78,4 +78,27 @@ describe Trackman::Assets::Asset do
78
78
 
79
79
  lambda { result = MyTestAsset.autosync }.should_not raise_error
80
80
  end
81
+
82
+ it "syncs if the env is not development or test" do
83
+ class Rails
84
+ def self.env
85
+ Env.new
86
+ end
87
+ end
88
+
89
+ class Env
90
+ def production?
91
+ false
92
+ end
93
+ def development?
94
+ false
95
+ end
96
+ def test?
97
+ false
98
+ end
99
+ end
100
+ MyTestAsset.should_receive(:sync)
101
+
102
+ MyTestAsset.autosync
103
+ end
81
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: