rack-dev-mark 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODliMDc5NTY2M2JkMzJhZmRlZmQ2YTA2OGYwNzk0NTJiNGRlYmQ5OA==
4
+ ZWFhYjIwOWI1NzI3MzQ0YWZiYjFiNTJiMTgyMzdlNGM3ODU2YTMxYw==
5
5
  data.tar.gz: !binary |-
6
- ZTgzMWI3MmQzMWQwN2IzZmI4ZTZmMzE4OTMxMWZhOTQxNzU1YmQ3Mg==
6
+ NzFhZjU3YzE5Zjg4ZGM1MGYzNzAzNDBiZWQ4ZmY0OTEwNDZjMzhjNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWVkYTM3MjVhZTE4OTQyNWYwODJhMGZmYzdkNTRjNDdkNWE3NWFmZDEyODM5
10
- NjAxODBkZTU0MWIyNTNjMTBkZDE5OTMwN2FhNzZlOTlhN2VmZmFhOWJlYjhi
11
- Mjc5ZTg0OWQ0ODVhMTg4OTIyZDBiMmNiYmYwN2FiMmZjMTgxN2Y=
9
+ MTdlYzU3OWNkMjE3ZDYxMTJkMjIzYjAzZWJjYjZjZDNhOWI4MTdhZmMwYWE1
10
+ MmM5MWFmYjE1ZDUzNzA5MzkzMjdiZjBkMzQ4MmJkODAzY2ZjOTdmZjI0NjUw
11
+ ZTQ5ZjVlOTM4ODlhNTE4NGRlN2RiZjQ3Y2NlODhkNTI0NTJlNzc=
12
12
  data.tar.gz: !binary |-
13
- MTZiY2IxNzY5OTE5ZTI3OWY3MjgzZDU4ZTJmOTgxMzk0MjE0ZDVmZDQ3ZTRi
14
- NmI5MjMyMjlhNmNmM2UyOWU2NDk3NTE2N2U1NGU1ZDFkODJlMjUyNzMwNzJm
15
- NmQxMGViZGUxOWI4YzEyY2MxMmE0MzUwNjdjOWRjYzRlMDk3OTE=
13
+ NTk2ZmFkZjgwNmNlYmE3YTE4ZjUzNTJjNDNhOTg0ZmMwNWY4ZGVlYzZjNzM5
14
+ MjdhMjYwMTdmYzdkYjhlY2I1YzNmOTYwNjBiYTNmNWExZmNkZDYzZGRlMWNh
15
+ NGI0ZDkwNDYyOTA0NTgyNTBlMmRhMzU1ZmQwNTUwMmM3MDZkMmY=
data/README.md CHANGED
@@ -1,19 +1,21 @@
1
1
  # rack-dev-mark
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rack-dev-mark.svg)](http://badge.fury.io/rb/rack-dev-mark) [![Build Status](https://secure.travis-ci.org/dtaniwaki/rack-dev-mark.png?branch=master)](http://travis-ci.org/dtaniwaki/rack-dev-mark) [![Coverage Status](https://coveralls.io/repos/dtaniwaki/rack-dev-mark/badge.png?branch=master)](https://coveralls.io/r/dtaniwaki/rack-dev-mark?branch=master) [![Code Climate](https://codeclimate.com/github/dtaniwaki/rack-dev-mark.png)](https://codeclimate.com/github/dtaniwaki/rack-dev-mark)
3
+ [![Gem Version](https://badge.fury.io/rb/rack-dev-mark.svg)](http://badge.fury.io/rb/rack-dev-mark) [![Build Status](https://secure.travis-ci.org/dtaniwaki/rack-dev-mark.png)](http://travis-ci.org/dtaniwaki/rack-dev-mark) [![Coverage Status](https://coveralls.io/repos/dtaniwaki/rack-dev-mark/badge.png)](https://coveralls.io/r/dtaniwaki/rack-dev-mark) [![Code Climate](https://codeclimate.com/github/dtaniwaki/rack-dev-mark.png)](https://codeclimate.com/github/dtaniwaki/rack-dev-mark)
4
4
 
5
5
  Differentiate development environment from production.
6
6
  You can choose [themes](lib/rack/dev-mark/theme/README.md) to differentiate the page.
7
7
 
8
8
  ## Screenshot
9
9
 
10
- ### Development
10
+ ![screenshot development](misc/screenshot.gif)
11
11
 
12
- ![screenshot development](screenshot-development.png)
12
+ ### On Development Env
13
13
 
14
- ### Production
14
+ ![screenshot development](misc/screenshot-development.png)
15
15
 
16
- ![screenshot production](screenshot-production.png)
16
+ ### On Production Env
17
+
18
+ ![screenshot production](misc/screenshot-production.png)
17
19
 
18
20
  ## Installation
19
21
 
@@ -77,6 +79,25 @@ module MyApp
77
79
  end
78
80
  ```
79
81
 
82
+ #### Heroku
83
+
84
+ Since Heroku [uses production env for staging](https://devcenter.heroku.com/articles/multiple-environments). You can use this settings instead.
85
+
86
+ ```ruby
87
+ module MyApp
88
+ class Application < Rails::Application
89
+ Rack::DevMark.env = ENV['RACK_DEV_MARK']
90
+ config.rack_dev_mark.enable = !Rails.env.production? || ENV['RACK_DEV_MARK']
91
+ end
92
+ end
93
+ ```
94
+
95
+ And set the environment variable.
96
+
97
+ ```bash
98
+ heroku config:set RACK_DEV_MARK=staging
99
+ ```
100
+
80
101
  ## Custom Theme
81
102
 
82
103
  Create your own theme class inheriting `Rack::DevMark::Theme::Base`.
data/lib/rack/dev-mark.rb CHANGED
@@ -11,9 +11,17 @@ module Rack
11
11
  @env ||= ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
12
12
  end
13
13
 
14
+ def self.env=(env)
15
+ @env = env
16
+ end
17
+
14
18
  def self.revision
15
19
  @revision ||= (::File.open('REVISION') { |f| f.read.strip } rescue nil)
16
20
  end
21
+
22
+ def self.revision=(revision)
23
+ @revision = revision
24
+ end
17
25
  end
18
26
  end
19
27
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module DevMark
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.6'
4
4
  end
5
5
  end
Binary file
@@ -11,7 +11,7 @@ describe Rack::DevMark do
11
11
  ENV['RAILS_ENV'] = @rails_env
12
12
  subject.instance_variable_set("@env", nil)
13
13
  end
14
- describe "::env" do
14
+ describe "::env" do
15
15
  it "returns development as default" do
16
16
  ENV['RAILS_ENV'] = nil
17
17
  ENV['RACK_ENV'] = nil
@@ -28,6 +28,12 @@ describe Rack::DevMark do
28
28
  expect(subject.env).to eq('def')
29
29
  end
30
30
  end
31
+ describe "::env=" do
32
+ it "sets custom env" do
33
+ Rack::DevMark.env = 'custom'
34
+ expect(Rack::DevMark.env).to eq('custom')
35
+ end
36
+ end
31
37
  describe "::revision" do
32
38
  after do
33
39
  ::File.delete('REVISION') if ::File.exists?('REVISION')
@@ -43,4 +49,10 @@ describe Rack::DevMark do
43
49
  expect(subject.revision).to eq(nil)
44
50
  end
45
51
  end
52
+ describe "::revision=" do
53
+ it "sets custom revision" do
54
+ Rack::DevMark.revision = 'custom'
55
+ expect(Rack::DevMark.revision).to eq('custom')
56
+ end
57
+ end
46
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dev-mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -101,9 +101,10 @@ files:
101
101
  - lib/rack/dev-mark/theme/title.rb
102
102
  - lib/rack/dev-mark/utils.rb
103
103
  - lib/rack/dev-mark/version.rb
104
+ - misc/screenshot-development.png
105
+ - misc/screenshot-production.png
106
+ - misc/screenshot.gif
104
107
  - rack-dev-mark.gemspec
105
- - screenshot-development.png
106
- - screenshot-production.png
107
108
  - spec/generators/rack/dev-mark/install_generator_spec.rb
108
109
  - spec/rack/dev-mark/middleware_spec.rb
109
110
  - spec/rack/dev-mark/railtie_spec.rb