Module: Rack::DevMark

Includes:
I18nHelper
Defined in:
lib/rack/dev-mark.rb,
lib/rack/dev-mark/error.rb,
lib/rack/dev-mark/theme.rb,
lib/rack/dev-mark/utils.rb,
lib/rack/dev-mark/railtie.rb,
lib/rack/dev-mark/version.rb,
lib/rack/dev-mark/theme/tag.rb,
lib/rack/dev-mark/middleware.rb,
lib/rack/dev-mark/theme/base.rb,
lib/rack/dev-mark/i18n_helper.rb,
lib/rack/dev-mark/theme/title.rb,
lib/rack/dev-mark/rails_options.rb,
lib/rack/dev-mark/theme/github_fork_ribbon.rb,
lib/rack/dev-mark/action_controller_helpers.rb,
lib/generators/rack/dev-mark/install_generator.rb

Defined Under Namespace

Modules: ActionControllerHelpers, I18nHelper, Theme, Utils Classes: Exception, InstallGenerator, Middleware, RailsOptions, Railtie, RuntimeError

Constant Summary collapse

VERSION =
'0.8.0'.freeze

Class Method Summary collapse

Methods included from I18nHelper

included

Class Method Details

.envObject



11
12
13
# File 'lib/rack/dev-mark.rb', line 11

def env
  @env ||= rack_dev_mark_env || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end

.env=(env) ⇒ Object



15
16
17
# File 'lib/rack/dev-mark.rb', line 15

def env=(env)
  @env = env
end

.rack_dev_mark_envObject



43
44
45
46
# File 'lib/rack/dev-mark.rb', line 43

def rack_dev_mark_env
  s = ENV['RACK_DEV_MARK_ENV']
  s.to_s == '' ? nil : s
end

.revisionObject



19
20
21
# File 'lib/rack/dev-mark.rb', line 19

def revision
  @revision ||= (::File.open('REVISION') { |f| f.read.strip } rescue nil)
end

.revision=(revision) ⇒ Object



23
24
25
# File 'lib/rack/dev-mark.rb', line 23

def revision=(revision)
  @revision = revision
end

.timestampObject



27
28
29
# File 'lib/rack/dev-mark.rb', line 27

def timestamp
  @timestamp ||= (::File.open('REVISION') { |f| f.mtime } rescue nil)
end

.timestamp=(timestamp) ⇒ Object



31
32
33
# File 'lib/rack/dev-mark.rb', line 31

def timestamp=(timestamp)
  @timestamp = timestamp.is_a?(Time) ? timestamp : Time.parse(timestamp)
end

.tmp_disabledObject



35
36
37
# File 'lib/rack/dev-mark.rb', line 35

def tmp_disabled
  Thread.current[:"rack-dev-mark__tmp_disabled"] ||= false
end

.tmp_disabled=(v) ⇒ Object



39
40
41
# File 'lib/rack/dev-mark.rb', line 39

def tmp_disabled=(v)
  Thread.current[:"rack-dev-mark__tmp_disabled"] = !!v
end