Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
tdreyno committed Aug 20, 2011
0 parents commit e6188a9
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.gem
.bundle
Gemfile.lock
pkg/*
.rvmrc
.DS_Store
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in middleman-remote-data.gemspec
gemspec
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'bundler'
Bundler::GemHelper.install_tasks
25 changes: 25 additions & 0 deletions lib/middleman-remote-data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "httparty"

module Middleman::Features::RemoteData
class << self
def registered(app)
app.extend ClassMethods
end
alias :included :registered
end

module ClassMethods
# Makes HTTP json data available in the data object
#
# data_source :my_json, "http://my/file.json"
#
# Available in templates as:
#
# data.my_json
def data_source(name, url)
data_callback(name) do
HTTParty.get(url).parsed_response
end
end
end
end
5 changes: 5 additions & 0 deletions lib/middleman-remote-data/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Middleman
module RemoteData
VERSION = "0.1.0"
end
end
1 change: 1 addition & 0 deletions lib/middleman_init.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "middleman-remote-data"
24 changes: 24 additions & 0 deletions middleman-remote-data.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "middleman-remote-data/version"

Gem::Specification.new do |s|
s.name = "middleman-remote-data"
s.version = Middleman::RemoteData::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Thomas Reynolds"]
s.email = ["me@tdreyno.com"]
s.homepage = "https://github.com/tdreyno/middleman-remote-data"
s.summary = %q{Adds remote JSON and XML data sources to Middleman}
s.description = %q{Adds remote JSON and XML data sources to Middleman}

s.rubyforge_project = "middleman-remote-data"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency("middleman", ["~> 2.0.4"])
s.add_runtime_dependency("httparty", ["~> 0.7.8"])
end

0 comments on commit e6188a9

Please sign in to comment.