middleman-data_source 0.3.0 → 0.4.0

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: f92c547722c3acc8279689d9f9b03f9bd22501fb
4
- data.tar.gz: 7c597e7a910b1fa2226131e2791d52b2783b8512
3
+ metadata.gz: 1103c960a4e677056993c7c122238ef8cd900479
4
+ data.tar.gz: 2c0cc6a97dffda9d2583668620915bb262f9c39b
5
5
  SHA512:
6
- metadata.gz: 1ad2e9d4c9ee45e674f37a784da7eb9b5f3082b3d15f59e81f4d9085a1e6819819f14eb4256c92ad85a76b3c8ad0a19c713fd0dedaf398f53a252cd6d3d9f384
7
- data.tar.gz: 642a9856acd83198fd44920d3a71d3b627dda1f64884eac09960b988fba9743b7e4ab161cead01220fd612e98cbd1a5a54b0e8b02e3e009c777da7e834309ce9
6
+ metadata.gz: 03f1c68acf968a58280fad1abd61de96bfeeb106c7896916d60c9d7ae34e160780b461e874d077d118c3f749cf013703c3c3f4ad81773153e8c758c1269d693d
7
+ data.tar.gz: 164d77b687d6d1c28b7ff60d1445ef89662cbe73fdfa32c6f4a4677a36a8ef38f893436234c9b8876e715f4923d7d5bf256c726f7ec984521d0cb8009176dd95
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.4.0
2
+ - add specs & support for middleman v4
3
+
1
4
  # 0.3.0
2
5
  - add support for using remote data imediatly after activating the extension
3
6
 
@@ -15,7 +15,7 @@ module Middleman
15
15
  def initialize app, options_hash={}, &block
16
16
  super app, options_hash, &block
17
17
 
18
- app_inst = app.inst
18
+ app_inst = app.respond_to?(:inst) ? app.inst : app
19
19
  remote_datas = if options.files.respond_to? :keys
20
20
  options.files
21
21
  else
@@ -1,7 +1,7 @@
1
1
  module Middleman
2
2
  module DataSource
3
3
 
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
 
6
6
  end
7
7
  end
@@ -3,9 +3,9 @@ set :show_exceptions, false
3
3
 
4
4
  activate :data_source do |c|
5
5
 
6
- c.rack_app = Rack::Builder.new do
7
- use Rack::Static, urls: ["/"],
8
- root: "remote_data"
6
+ c.rack_app = ::Rack::Builder.new do
7
+ use ::Rack::Static, urls: ["/"],
8
+ root: "remote_data"
9
9
  run lambda {|env| [404, {'Content-type' => 'text/plain'}, ['Not found']] }
10
10
  end
11
11
 
@@ -109,7 +109,8 @@ describe Middleman::DataSource::Extension do
109
109
  Given.fixture 'imediate_use'
110
110
  @mm = Middleman::Fixture.app
111
111
 
112
- expect( @mm.remote_data ).to match_array [{"item"=>"one"},{"item"=>"two"}]
112
+ data = (@mm.respond_to?(:config) && @mm.config.respond_to?(:setting)) ? @mm.config.setting(:remote_data).value : @mm.remote_data
113
+ expect( data ).to match_array [{"item"=>"one"},{"item"=>"two"}]
113
114
  end
114
115
 
115
116
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rspec'
2
+ require 'rack/builder'
2
3
  require 'rack/test'
3
4
  require 'middleman'
4
5
 
@@ -1,19 +1,30 @@
1
+
2
+ begin
3
+ require 'middleman-core/rack'
4
+ rescue LoadError
5
+ end
6
+
7
+
1
8
  module Middleman
2
9
  module Fixture
3
10
 
4
11
  class << self
5
12
 
6
- def default env=:test
7
- Middleman::Application.server.inst do
8
- set :environment, env
9
- end
10
- end
11
-
12
13
  def app &block
13
14
  ENV['MM_ROOT'] = Given::TMP
14
- Middleman::Application.server.inst do
15
- instance_eval(&block) if block
15
+
16
+ if Middleman::Application.respond_to?(:server)
17
+ app = Middleman::Application.server.inst do
18
+ instance_eval(&block) if block
19
+ end
20
+ else
21
+ require 'middleman-core/renderers/sass'
22
+ app = Middleman::Application.new do
23
+ instance_eval(&block) if block
24
+ end
16
25
  end
26
+
27
+ app
17
28
  end
18
29
 
19
30
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-data_source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rack-test
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.6.2
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: borrower
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
98
  version: '0'
85
99
  requirements: []
86
100
  rubyforge_project:
87
- rubygems_version: 2.4.3
101
+ rubygems_version: 2.4.5
88
102
  signing_key:
89
103
  specification_version: 4
90
104
  summary: Allow for loading data in middleman from remote sources