middleman-remote-data 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/lib/middleman-remote-data.rb +25 -0
- data/lib/middleman-remote-data/version.rb +5 -0
- data/lib/middleman_init.rb +1 -0
- data/middleman-remote-data.gemspec +24 -0
- metadata +103 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require "httparty"
|
2
|
+
|
3
|
+
module Middleman::Features::RemoteData
|
4
|
+
class << self
|
5
|
+
def registered(app)
|
6
|
+
app.extend ClassMethods
|
7
|
+
end
|
8
|
+
alias :included :registered
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
# Makes HTTP json data available in the data object
|
13
|
+
#
|
14
|
+
# data_source :my_json, "http://my/file.json"
|
15
|
+
#
|
16
|
+
# Available in templates as:
|
17
|
+
#
|
18
|
+
# data.my_json
|
19
|
+
def data_source(name, url)
|
20
|
+
data_callback(name) do
|
21
|
+
HTTParty.get(url).parsed_response
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "middleman-remote-data"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "middleman-remote-data/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "middleman-remote-data"
|
7
|
+
s.version = Middleman::RemoteData::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Thomas Reynolds"]
|
10
|
+
s.email = ["me@tdreyno.com"]
|
11
|
+
s.homepage = "https://github.com/tdreyno/middleman-remote-data"
|
12
|
+
s.summary = %q{Adds remote JSON and XML data sources to Middleman}
|
13
|
+
s.description = %q{Adds remote JSON and XML data sources to Middleman}
|
14
|
+
|
15
|
+
s.rubyforge_project = "middleman-remote-data"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_runtime_dependency("middleman", ["~> 2.0.4"])
|
23
|
+
s.add_runtime_dependency("httparty", ["~> 0.7.8"])
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: middleman-remote-data
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Thomas Reynolds
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-20 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: middleman
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 7
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 0
|
32
|
+
- 4
|
33
|
+
version: 2.0.4
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: httparty
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 19
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 7
|
48
|
+
- 8
|
49
|
+
version: 0.7.8
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
description: Adds remote JSON and XML data sources to Middleman
|
53
|
+
email:
|
54
|
+
- me@tdreyno.com
|
55
|
+
executables: []
|
56
|
+
|
57
|
+
extensions: []
|
58
|
+
|
59
|
+
extra_rdoc_files: []
|
60
|
+
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- Rakefile
|
65
|
+
- lib/middleman-remote-data.rb
|
66
|
+
- lib/middleman-remote-data/version.rb
|
67
|
+
- lib/middleman_init.rb
|
68
|
+
- middleman-remote-data.gemspec
|
69
|
+
homepage: https://github.com/tdreyno/middleman-remote-data
|
70
|
+
licenses: []
|
71
|
+
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options: []
|
74
|
+
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
95
|
+
requirements: []
|
96
|
+
|
97
|
+
rubyforge_project: middleman-remote-data
|
98
|
+
rubygems_version: 1.8.6
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: Adds remote JSON and XML data sources to Middleman
|
102
|
+
test_files: []
|
103
|
+
|