middleman-data_source 0.4.0 → 0.5.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: 1103c960a4e677056993c7c122238ef8cd900479
4
- data.tar.gz: 2c0cc6a97dffda9d2583668620915bb262f9c39b
3
+ metadata.gz: f007a9a894f8c5fc6d56b47a8e238939b96fbf12
4
+ data.tar.gz: 03abe96ea5700bb92236b4f00fc0681b279d33f9
5
5
  SHA512:
6
- metadata.gz: 03f1c68acf968a58280fad1abd61de96bfeeb106c7896916d60c9d7ae34e160780b461e874d077d118c3f749cf013703c3c3f4ad81773153e8c758c1269d693d
7
- data.tar.gz: 164d77b687d6d1c28b7ff60d1445ef89662cbe73fdfa32c6f4a4677a36a8ef38f893436234c9b8876e715f4923d7d5bf256c726f7ec984521d0cb8009176dd95
6
+ metadata.gz: 0f38a7aade0e3d9f051c37fe2095aacf13a8bc070d66072e9ed95051b09087ff01a1900052baf8aa9aefcc47f201fd93441bcd8477c71e924c145c539a6958b5
7
+ data.tar.gz: a01f2c2bc6beacfb1a8e606241ff3a2fb5a4b66c159706f32145be7e57d820fe6f707ed584bea12c1449d3d14b91e1ae84c7dd52deb7f7635fb23f78c697c586
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.5.0
2
+ - include support for resources that include query params after their file extension [@jordanandree]
3
+
1
4
  # 0.4.0
2
5
  - add specs & support for middleman v4
3
6
 
@@ -25,9 +25,10 @@ module Middleman
25
25
  end
26
26
 
27
27
  remote_datas.each do |remote_file, local_representation|
28
- extension = File.extname remote_file
29
- parts = local_representation.split(File::SEPARATOR)
30
- basename = File.basename parts.pop, extension
28
+ raw_extension = File.extname(remote_file)
29
+ extension = raw_extension.split('?').first
30
+ parts = local_representation.split(File::SEPARATOR)
31
+ basename = File.basename(parts.pop, raw_extension)
31
32
 
32
33
  if parts.empty?
33
34
  original_callback = app_inst.data.callbacks[basename]
@@ -1,7 +1,7 @@
1
1
  module Middleman
2
2
  module DataSource
3
3
 
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
 
6
6
  end
7
7
  end
@@ -14,7 +14,8 @@ activate :data_source do |c|
14
14
  'deeply/nested.json',
15
15
  'deeply/nested/routes.json',
16
16
  'in_yaml.yml',
17
- 'in_json.json'
17
+ 'in_json.json',
18
+ 'query_param.json?token=foo'
18
19
  ]
19
20
 
20
21
  end
@@ -10,7 +10,8 @@ activate :data_source do |c|
10
10
  'deeply/nested.json',
11
11
  'deeply/nested/routes.json',
12
12
  'in_yaml.yml',
13
- 'in_json.json'
13
+ 'in_json.json',
14
+ 'query_param.json?token=foo'
14
15
  ]
15
16
 
16
17
  end
@@ -15,6 +15,10 @@ describe Middleman::DataSource::Extension do
15
15
  expect( @mm.data.deeply.nested.routes ).to eq [{"item" => "one"}, {"item" => "two"}]
16
16
  end
17
17
 
18
+ it "supports query params" do
19
+ expect( @mm.data.query_param ).to eq [{"foo" => "bar"}]
20
+ end
21
+
18
22
  it "attempts to not clobber data of overlapping nested routes (if it's hashes)" do
19
23
  expect( @mm.data.deeply.nested.has_key? "nestable" ).to eq true
20
24
  expect( @mm.data.deeply.nested["nestable"] ).to eq "data"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-data_source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman