napa 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0656c5cfb68fbe78e50bcdaf0801223aa080b5d8
4
- data.tar.gz: d41e0ac597f0377b8a8503eb511ed0e4b9b15d52
3
+ metadata.gz: 85be84826e98fa6f4a7108ea9650afacd5136a03
4
+ data.tar.gz: 890e77a8fc87a8a9526a92b2b8252306774a3409
5
5
  SHA512:
6
- metadata.gz: 0f836563f066fd8be7e31f45b6005a2dee477072a1d52100eba1f834fb680565b6bcc411b523411677c94c32a6f31cf54644cac927ec6eab2e3c181893a08180
7
- data.tar.gz: 8f31591367c3f71de85d7a4837f296774f3ed38a2f3df58652d5e0d3c03d515222e2929ad6237e47703f45d5ea4747fedd26c3f4266231079ab361a641fdb059
6
+ metadata.gz: eabb2e57c9d1db9f0ff358e6906a6ee98e7cd2298a7d59e68ba4ceef64cd635a937323e150642c6b027a7c0d910cde55a6891f8c3ee8056e59a9d78a132f9ffb
7
+ data.tar.gz: 9275bea4d4c8d9494f385db6f48834946717bba0b117e9c6c7027a9f22a84753a942b16ca8dfb25b8f5bb94fb97c7de05b9db1a1f776ee950a61fc7d9d543e6d
@@ -4,3 +4,4 @@ class <%= name.classify %>Entity < Grape::Entity
4
4
  { type: 'String', description: 'ID' }
5
5
  expose :type, proc: lambda { |o, opts| o.class.name.underscore }, documentation:
6
6
  { type: 'String', description: '"<%= name.underscore %>"' }
7
+ end
@@ -1,7 +1,8 @@
1
1
  # load bundler
2
2
  Bundler.setup(:default)
3
- require 'napa'
3
+ require 'napa/setup'
4
4
  Bundler.require(:default, Napa.env.to_sym)
5
+ require 'napa'
5
6
  require 'will_paginate'
6
7
  require 'will_paginate/active_record'
7
8
 
data/lib/napa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Napa
2
- VERSION = '0.1.16'
2
+ VERSION = '0.1.17'
3
3
 
4
4
  class Version
5
5
  class << self
data/lib/napa.rb CHANGED
@@ -7,12 +7,14 @@ require 'grape'
7
7
  require 'json'
8
8
 
9
9
  # require internal files
10
+ require 'setup'
10
11
  require 'napa/version'
11
12
  require 'napa/logger/logger'
12
13
  require 'napa/logger/log_transaction'
13
14
  require 'napa/identity'
14
15
  require 'napa/json_error'
15
16
  require 'napa/stats'
17
+ require 'napa/active_record_extensions/filter_by_hash'
16
18
  require 'napa/grape_extensions/error_formatter'
17
19
  require 'napa/grape_extensions/error_presenter'
18
20
  require 'napa/middleware/logger'
@@ -30,15 +32,3 @@ if defined?(Rake)
30
32
  load 'tasks/routes.rake'
31
33
  load 'tasks/db.rake'
32
34
  end
33
-
34
- module Napa
35
- class << self
36
- def env
37
- @_env ||= ActiveSupport::StringInquirer.new(ENV['RACK_ENV'] || 'development')
38
- end
39
-
40
- def env=(environment)
41
- @_env = ActiveSupport::StringInquirer.new(environment)
42
- end
43
- end
44
- end
data/lib/setup.rb ADDED
@@ -0,0 +1,16 @@
1
+ # setup for napa
2
+ # require the files that are required before everything else in napa
3
+ # useful if you want to use any variables/methods defined here without loading the rest of napa immediately
4
+ require 'active_support'
5
+
6
+ module Napa
7
+ class << self
8
+ def env
9
+ @_env ||= ActiveSupport::StringInquirer.new(ENV['RACK_ENV'] || 'development')
10
+ end
11
+
12
+ def env=(environment)
13
+ @_env = ActiveSupport::StringInquirer.new(environment)
14
+ end
15
+ end
16
+ end
@@ -1,9 +1,11 @@
1
- desc "display all routes"
2
- task :routes do
3
- grape_apis = ObjectSpace.each_object(Class).select { |klass| klass < Grape::API }
4
- grape_apis.each do |api|
5
- api.routes.each do |r|
6
- puts "#{r}"
1
+ unless defined?(Rails)
2
+ desc "display all routes"
3
+ task :routes do
4
+ grape_apis = ObjectSpace.each_object(Class).select { |klass| klass < Grape::API }
5
+ grape_apis.each do |api|
6
+ api.routes.each do |r|
7
+ puts "#{r}"
8
+ end
7
9
  end
8
10
  end
9
- end
11
+ end
data/napa.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |gem|
24
24
  gem.add_dependency 'virtus'
25
25
  gem.add_dependency 'grape'
26
26
  gem.add_dependency 'grape-swagger'
27
+ gem.add_dependency 'grape-entity'
27
28
  gem.add_dependency 'unicorn'
28
29
  gem.add_dependency 'statsd-ruby'
29
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: napa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darby Frey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: grape-entity
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: unicorn
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +290,7 @@ files:
276
290
  - lib/napa/middleware/request_stats.rb
277
291
  - lib/napa/stats.rb
278
292
  - lib/napa/version.rb
293
+ - lib/setup.rb
279
294
  - lib/tasks/db.rake
280
295
  - lib/tasks/deploy.rake
281
296
  - lib/tasks/git.rake