rinfo 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +7 -1
- data/.travis.yml +2 -3
- data/README.md +10 -1
- data/Rakefile +3 -1
- data/app/controllers/rinfo_controller.rb +4 -1
- data/config/application.rb +1 -1
- data/config/database.yml +5 -0
- data/lib/rinfo.rb +3 -1
- data/lib/rinfo/cache.rb +16 -0
- data/lib/rinfo/version.rb +1 -1
- data/rinfo.gemspec +14 -8
- data/spec/controllers/rinfo_controller_spec.rb +6 -0
- data/spec/spec_helper.rb +3 -0
- metadata +36 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba2d5c8467354ec83f1272f7dbf84ebd7fe50f5
|
4
|
+
data.tar.gz: 934158ff2e6dbd04228f5eecd177c1b7dc78ec54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a541a36b1f655c28d0a1cc54988185c666b561abe1e169fcab27373d24e791be44f29f9341e0cd0b3a594edcfad1b0eeae56b204d7334f61f58fb76080a1510
|
7
|
+
data.tar.gz: 5df7f9925d84bb8fb1b7d4a2788f51892fbfc5a70552150f023799d4b92f7618f0f43be50f4cc76b0961120773ff8c4491c4a6959fd4b6290653a0a82566fef7
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Rinfo
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/rinfo.png)](http://badge.fury.io/rb/rinfo)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rinfo.png)](http://badge.fury.io/rb/rinfo)
|
4
|
+
[![Build Status](https://travis-ci.org/rafecolton/rinfo.png?branch=master)](https://travis-ci.org/rafecolton/rinfo)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/rafecolton/rinfo.png)](https://codeclimate.com/github/rafecolton/rinfo)
|
4
6
|
|
5
7
|
## Usage
|
6
8
|
|
@@ -46,6 +48,7 @@ made at run time:
|
|
46
48
|
To add `rinfo` to your Rails application, add the `rinfo` gem to your `Gemfile`:
|
47
49
|
|
48
50
|
```ruby
|
51
|
+
# Gemfile
|
49
52
|
gem 'rinfo'
|
50
53
|
```
|
51
54
|
|
@@ -88,3 +91,9 @@ your `RAILS_ENV`
|
|
88
91
|
The `filename` attribute allows you to set the filename at which your
|
89
92
|
release information is available. The default value of `rinfo.json` will
|
90
93
|
mean your file is available at `/rinfo.json`.
|
94
|
+
|
95
|
+
## Contributing
|
96
|
+
|
97
|
+
0. Fork it
|
98
|
+
0. Do your thing
|
99
|
+
0. Submit a pull request
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'bundler/setup'
|
3
5
|
rescue LoadError
|
@@ -13,7 +15,7 @@ require 'rspec/core/rake_task'
|
|
13
15
|
|
14
16
|
desc 'Run rubocop'
|
15
17
|
task :rubocop do
|
16
|
-
sh('rubocop --format simple'){ |ok, _| ok || abort }
|
18
|
+
sh('rubocop --format simple') { |ok, _| ok || abort }
|
17
19
|
end
|
18
20
|
|
19
21
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
data/config/application.rb
CHANGED
data/config/database.yml
ADDED
data/lib/rinfo.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require 'rinfo/engine'
|
4
|
+
require 'rinfo/cache'
|
4
5
|
require 'git'
|
6
|
+
require 'time'
|
5
7
|
|
6
8
|
class Rinfo
|
7
9
|
autoload :VERSION, 'rinfo/version'
|
@@ -63,7 +65,7 @@ class Rinfo
|
|
63
65
|
end
|
64
66
|
|
65
67
|
def date
|
66
|
-
git.log.first.date
|
68
|
+
git.log.first.date.iso8601
|
67
69
|
end
|
68
70
|
|
69
71
|
def branch
|
data/lib/rinfo/cache.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class MemoryCache
|
4
|
+
include Singleton
|
5
|
+
|
6
|
+
# create a private instance of MemoryStore
|
7
|
+
def initialize
|
8
|
+
@memory_store = ::ActiveSupport::Cache::MemoryStore.new
|
9
|
+
end
|
10
|
+
|
11
|
+
# this will allow our MemoryCache to be called just like Rails.cache
|
12
|
+
# every method passed to it will be passed to our MemoryStore
|
13
|
+
def method_missing(m, *args, &block)
|
14
|
+
@memory_store.send(m, *args, &block)
|
15
|
+
end
|
16
|
+
end
|
data/lib/rinfo/version.rb
CHANGED
data/rinfo.gemspec
CHANGED
@@ -3,32 +3,38 @@
|
|
3
3
|
lib = File.expand_path('../lib', __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
|
6
|
-
$TOP = File.expand_path('..', __FILE__)
|
7
|
-
|
8
6
|
require 'rinfo/version'
|
9
7
|
|
10
8
|
Gem::Specification.new do |gem|
|
11
9
|
gem.name = 'rinfo'
|
12
10
|
gem.version = Rinfo::VERSION
|
13
|
-
gem.authors = ['Rafe Colton']
|
14
|
-
gem.email = ['
|
11
|
+
gem.authors = ['Rafe Colton', 'Nick Rowe']
|
12
|
+
gem.email = ['rafael.colton@gmail.com', 'n.rowe@modcloth.com']
|
15
13
|
gem.homepage = 'https://github.com/rafecolton/rinfo'
|
16
14
|
gem.summary = 'Generates an rinfo.json page for your Rails app'
|
17
15
|
gem.description = 'Generates an rinfo.json page for your Rails app'
|
18
16
|
gem.license = 'MIT'
|
19
17
|
|
20
|
-
gem.files = `git ls-files`.split(
|
18
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
21
19
|
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
20
|
gem.bindir = 'bin'
|
23
21
|
gem.test_files = gem.files.grep(%r{^spec/})
|
24
22
|
gem.require_paths = ['lib']
|
25
23
|
gem.required_ruby_version = '>= 1.9.3'
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
# dev/test dependencies
|
26
|
+
gem.add_development_dependency 'rake'
|
27
|
+
gem.add_development_dependency 'rspec'
|
28
|
+
gem.add_development_dependency 'rubocop'
|
29
|
+
gem.add_development_dependency 'rspec-rails'
|
30
|
+
gem.add_development_dependency 'simplecov'
|
31
|
+
gem.add_development_dependency 'sqlite3' unless RUBY_PLATFORM == 'java'
|
32
|
+
gem.add_development_dependency 'activerecord-jdbcsqlite3-adapter' if RUBY_PLATFORM == 'java'
|
33
|
+
|
34
|
+
# dev/test deps, no jruby
|
30
35
|
gem.add_development_dependency 'pry' unless RUBY_PLATFORM == 'java'
|
31
36
|
|
37
|
+
# full dependencies
|
32
38
|
gem.add_dependency 'rails', '>= 3'
|
33
39
|
gem.add_dependency 'git'
|
34
40
|
end
|
@@ -29,6 +29,7 @@ describe RinfoController, type: :controller do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
before(:each) do
|
32
|
+
::MemoryCache.instance.clear
|
32
33
|
Rinfo.stub(:root).and_return(@tmpdir)
|
33
34
|
end
|
34
35
|
|
@@ -80,6 +81,7 @@ describe RinfoController, type: :controller do
|
|
80
81
|
|
81
82
|
it 'displays rinfo for all envs not on the blacklist' do
|
82
83
|
default_whitelist.each do |env|
|
84
|
+
::MemoryCache.instance.clear
|
83
85
|
Rinfo.stub(:env).and_return(env.to_s)
|
84
86
|
get 'info', format: :json
|
85
87
|
response.body.should == rinfo
|
@@ -94,6 +96,7 @@ describe RinfoController, type: :controller do
|
|
94
96
|
|
95
97
|
it 'displays rinfo for all envs' do
|
96
98
|
rails_envs.each do |env|
|
99
|
+
::MemoryCache.instance.clear
|
97
100
|
Rinfo.stub(:env).and_return(env.to_s)
|
98
101
|
get 'info', format: :json
|
99
102
|
response.body.should == rinfo
|
@@ -108,6 +111,7 @@ describe RinfoController, type: :controller do
|
|
108
111
|
|
109
112
|
it 'does not display rinfo for any envs' do
|
110
113
|
rails_envs.each do |env|
|
114
|
+
::MemoryCache.instance.clear
|
111
115
|
Rinfo.stub(:env).and_return(env.to_s)
|
112
116
|
expect { get 'info', format: :json }.to raise_error(
|
113
117
|
ActionController::RoutingError
|
@@ -123,6 +127,7 @@ describe RinfoController, type: :controller do
|
|
123
127
|
|
124
128
|
it 'does not display rinfo for blacklisted envs' do
|
125
129
|
custom_blacklist.each do |env|
|
130
|
+
::MemoryCache.instance.clear
|
126
131
|
Rinfo.stub(:env).and_return(env.to_s)
|
127
132
|
expect { get 'info', format: :json }.to raise_error(
|
128
133
|
ActionController::RoutingError
|
@@ -132,6 +137,7 @@ describe RinfoController, type: :controller do
|
|
132
137
|
|
133
138
|
it 'displays rinfo for non-blacklisted envs' do
|
134
139
|
(rails_envs - custom_blacklist).each do |env|
|
140
|
+
::MemoryCache.instance.clear
|
135
141
|
Rinfo.stub(:env).and_return(env.to_s)
|
136
142
|
get 'info', format: :json
|
137
143
|
response.body.should == rinfo
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafe Colton
|
8
|
+
- Nick Rowe
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
@@ -66,6 +67,34 @@ dependencies:
|
|
66
67
|
- - '>='
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: simplecov
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: sqlite3
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
69
98
|
- !ruby/object:Gem::Dependency
|
70
99
|
name: pry
|
71
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +139,8 @@ dependencies:
|
|
110
139
|
version: '0'
|
111
140
|
description: Generates an rinfo.json page for your Rails app
|
112
141
|
email:
|
113
|
-
-
|
142
|
+
- rafael.colton@gmail.com
|
143
|
+
- n.rowe@modcloth.com
|
114
144
|
executables:
|
115
145
|
- rails
|
116
146
|
extensions: []
|
@@ -133,11 +163,13 @@ files:
|
|
133
163
|
- config.ru
|
134
164
|
- config/application.rb
|
135
165
|
- config/boot.rb
|
166
|
+
- config/database.yml
|
136
167
|
- config/environment.rb
|
137
168
|
- config/environments/test.rb
|
138
169
|
- config/initializers/secret_token.rb
|
139
170
|
- config/routes.rb
|
140
171
|
- lib/rinfo.rb
|
172
|
+
- lib/rinfo/cache.rb
|
141
173
|
- lib/rinfo/engine.rb
|
142
174
|
- lib/rinfo/version.rb
|
143
175
|
- lib/tasks/rinfo_tasks.rake
|
@@ -164,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
196
|
version: '0'
|
165
197
|
requirements: []
|
166
198
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
199
|
+
rubygems_version: 2.2.2
|
168
200
|
signing_key:
|
169
201
|
specification_version: 4
|
170
202
|
summary: Generates an rinfo.json page for your Rails app
|