haveapi 0.5.1 → 0.5.2

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: d0636ca57e2a87e59f81a5396a30d2747720177a
4
- data.tar.gz: b00b91162f6256d45c60774888add72b2a7c37cc
3
+ metadata.gz: 8579fbd8dd467b3248bba5d3cd8cbb46c889621b
4
+ data.tar.gz: 12fa89e290d89ea301123f66ca86e6bfc19c4785
5
5
  SHA512:
6
- metadata.gz: a468585dbf8bb2c7319a102cf5d1399f07e06b294b457f8a518c2c5a53882e94753cca55123d6727909111d5baaa2aa2a010d0f3665b6bb972488acea057c995
7
- data.tar.gz: 0300f25310364e1ec6d598f4550b6699ff90bd0e701ecc942c89d67ef9c4622ac8bc8134c2d5ea21154746a796bbdd9a6bf8120318bc4c95beafb61b24f17b25
6
+ metadata.gz: f406e97a08f0ae4c4b0fb6dab2114a36208f8ef6190f5480b9a86765dc97005ddf866402674164ae96d36f989e6ea40ed5f6e2e75d56a442751cf2e4e9613c0f
7
+ data.tar.gz: 2f5d0ebae55c055ac725097260b2fecbea6903b74d7927fc723186e6bacf708376a6cce978bea15c6594c44302e6d7547bc226f8a46f5d863417a9d7cc989a8c
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ * Thu Mar 03 2016 - version 0.5.2
2
+ - Fix ActiveRecord dependency
3
+ - Require json
4
+ - Fix params_spec
5
+
1
6
  * Fri Feb 26 2016 - version 0.5.1
2
7
  - Fix call of an empty hook
3
8
 
data/haveapi.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'haveapi/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'haveapi'
7
7
  s.version = HaveAPI::VERSION
8
- s.date = '2016-02-26'
8
+ s.date = '2016-03-03'
9
9
  s.summary =
10
10
  s.description = 'Framework for creating self-describing APIs'
11
11
  s.authors = 'Jakub Skokan'
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_runtime_dependency 'require_all'
19
19
  s.add_runtime_dependency 'json'
20
+ s.add_runtime_dependency 'activesupport', '~> 4.1.14'
20
21
  s.add_runtime_dependency 'sinatra', '~> 1.4.6'
21
22
  s.add_runtime_dependency 'tilt', '~> 1.4.1'
22
23
  s.add_runtime_dependency 'redcarpet', '~> 3.3.4'
@@ -146,7 +146,7 @@ module HaveAPI
146
146
  end
147
147
 
148
148
  after do
149
- ActiveRecord::Base.clear_active_connections!
149
+ ActiveRecord::Base.clear_active_connections! if Object.const_defined?(:ActiveRecord)
150
150
  end
151
151
  end
152
152
 
@@ -1,4 +1,4 @@
1
1
  module HaveAPI
2
2
  PROTOCOL_VERSION = '1.0'
3
- VERSION = '0.5.1'
3
+ VERSION = '0.5.2'
4
4
  end
data/lib/haveapi.rb CHANGED
@@ -1,11 +1,13 @@
1
- ar = defined?(:ActiveRecord)
1
+ ar = Object.const_defined?(:ActiveRecord)
2
2
 
3
3
  require 'require_all'
4
+ require 'active_support/inflector'
4
5
  require 'active_record' if ar
5
6
  require 'sinatra/base'
6
7
  require 'sinatra/activerecord' if ar
7
8
  require 'pp'
8
9
  require 'github/markdown'
10
+ require 'json'
9
11
 
10
12
  module HaveAPI
11
13
  module Actions
data/spec/params_spec.rb CHANGED
@@ -183,8 +183,8 @@ describe HaveAPI::Params do
183
183
  string :param2
184
184
  end)
185
185
  p.exec
186
-
187
- expect(p[:param1]).to eq(p.params.first)
188
- expect(p[:param2]).to eq(p.params.second)
186
+
187
+ expect(p[:param1]).to eq(p.params[0])
188
+ expect(p[:param2]).to eq(p.params[1])
189
189
  end
190
190
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haveapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-26 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: require_all
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 4.1.14
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 4.1.14
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: sinatra
43
57
  requirement: !ruby/object:Gem::Requirement