tumblargh 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. data/.gitignore +2 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +15 -0
  4. data/Gemfile.lock +52 -0
  5. data/LICENSE +20 -0
  6. data/README.md +84 -0
  7. data/Rakefile +43 -0
  8. data/VERSION +1 -0
  9. data/examples/confg.ru +18 -0
  10. data/examples/middleman_config.rb +7 -0
  11. data/lib/middleman/features/tumblargh.rb +41 -0
  12. data/lib/rack/tumblargh.rb +51 -0
  13. data/lib/tumblargh.rb +60 -0
  14. data/lib/tumblargh/api.rb +60 -0
  15. data/lib/tumblargh/grammar.rb +560 -0
  16. data/lib/tumblargh/grammar.treetop +42 -0
  17. data/lib/tumblargh/node.rb +14 -0
  18. data/lib/tumblargh/node/base.rb +21 -0
  19. data/lib/tumblargh/node/block.rb +31 -0
  20. data/lib/tumblargh/node/block_end.rb +9 -0
  21. data/lib/tumblargh/node/block_start.rb +22 -0
  22. data/lib/tumblargh/node/literal.rb +9 -0
  23. data/lib/tumblargh/node/root.rb +17 -0
  24. data/lib/tumblargh/node/tag.rb +33 -0
  25. data/lib/tumblargh/parser.rb +96 -0
  26. data/lib/tumblargh/renderer.rb +316 -0
  27. data/lib/tumblargh/renderer/base.rb +64 -0
  28. data/lib/tumblargh/renderer/blocks/answer.rb +22 -0
  29. data/lib/tumblargh/renderer/blocks/audio.rb +70 -0
  30. data/lib/tumblargh/renderer/blocks/base.rb +35 -0
  31. data/lib/tumblargh/renderer/blocks/dates.rb +62 -0
  32. data/lib/tumblargh/renderer/blocks/navigation.rb +65 -0
  33. data/lib/tumblargh/renderer/blocks/notes.rb +68 -0
  34. data/lib/tumblargh/renderer/blocks/posts.rb +50 -0
  35. data/lib/tumblargh/renderer/blocks/reblogs.rb +50 -0
  36. data/lib/tumblargh/renderer/blocks/tags.rb +37 -0
  37. data/lib/tumblargh/renderer/document.rb +70 -0
  38. data/lib/tumblargh/renderer/literal.rb +9 -0
  39. data/lib/tumblargh/renderer/tag.rb +37 -0
  40. data/lib/tumblargh/resource.rb +12 -0
  41. data/lib/tumblargh/resource/base.rb +39 -0
  42. data/lib/tumblargh/resource/blog.rb +49 -0
  43. data/lib/tumblargh/resource/note.rb +8 -0
  44. data/lib/tumblargh/resource/post.rb +63 -0
  45. data/lib/tumblargh/resource/tag.rb +8 -0
  46. data/lib/tumblargh/resource/user.rb +8 -0
  47. data/spec/api_spec.rb +1 -0
  48. data/spec/fixtures/data/staff.tumblr.com-2012-05-06/posts.json +1203 -0
  49. data/spec/fixtures/themes/fluid.html +1138 -0
  50. data/spec/fixtures/themes/solstice.html +392 -0
  51. data/spec/parser_spec.rb +159 -0
  52. data/spec/renderer/blocks/posts_spec.rb +17 -0
  53. data/spec/renderer/document_spec.rb +57 -0
  54. data/spec/resource/post_spec.rb +38 -0
  55. data/spec/resource_spec.rb +23 -0
  56. data/spec/spec_helper.rb +24 -0
  57. data/spec/tumblargh_spec.rb +50 -0
  58. data/tumblargh.gemspec +120 -0
  59. metadata +237 -0
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tumblargh::Renderer::Blocks::Posts do
4
+
5
+ before do
6
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
7
+ @json = ActiveSupport::JSON.decode(open(json_path).read)["response"].with_indifferent_access
8
+ end
9
+
10
+ it "should render the correct amount of posts" do
11
+ theme = "{block:Posts}!{/block:Posts}"
12
+
13
+ result = Tumblargh.render_html(theme, @json)
14
+ result.count("!").should eql @json[:posts].size
15
+ end
16
+
17
+ end
@@ -0,0 +1,57 @@
1
+ require 'spec_helper'
2
+
3
+
4
+ describe Tumblargh::Renderer::Document do
5
+
6
+ before do
7
+ @parser = Tumblargh::Parser.new
8
+ end
9
+
10
+ describe "boolean blocks" do
11
+
12
+ before do
13
+ @parser.html = <<-eos
14
+ {block:IfSomethingOnByDefault}
15
+ PASS_ON
16
+ {/block:IfSomethingOnByDefault}
17
+
18
+ {block:IfSomethingOffByDefault}
19
+ FAIL_OFF
20
+ {/block:IfSomethingOffByDefault}
21
+
22
+ {block:IfNotSomethingOnByDefault}
23
+ FAIL_INVERSE_ON
24
+ {/block:IfNotSomethingOnByDefault}
25
+
26
+ {block:IfNotSomethingOffByDefault}
27
+ PASS_INVERSE_OFF
28
+ {/block:IfNotSomethingOffByDefault}
29
+
30
+
31
+ eos
32
+
33
+ options = {
34
+ "if" => {
35
+ "somethingonbydefault" => true,
36
+ "somethingoffbydefault" => false
37
+ }
38
+ }
39
+
40
+ @document = Tumblargh::Renderer::Document.new(@parser.tree, nil, options)
41
+ @output = @document.render
42
+ end
43
+
44
+ it "should respect the default settings" do
45
+ @output.should match /PASS_ON/
46
+ @output.should_not match /FAIL_OFF/
47
+ end
48
+
49
+
50
+ it "inverse (IfNot) blocks should work" do
51
+ @output.should_not match /FAIL_INVERSE_ON/
52
+ @output.should match /PASS_INVERSE_OFF/
53
+ end
54
+
55
+ end
56
+
57
+ end
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tumblargh::Resource::Post do
4
+
5
+ before do
6
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
7
+ @json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
8
+ @blog = Tumblargh::Resource::Blog.new("staff.tumblr.com", @json)
9
+ @posts = @blog.posts
10
+ end
11
+
12
+ it "should have an instance of Time for its date attribute" do
13
+ @posts.each do |post|
14
+ post.date.should be_an_instance_of Time
15
+ end
16
+ end
17
+
18
+ it "should always return an array of tags" do
19
+ @posts.each do |post|
20
+ post.tags.should be_an_instance_of Array
21
+ end
22
+ end
23
+
24
+ it "should correctly parse the number of tags" do
25
+ @posts.each do |post|
26
+ post.tags.size.should eql post.attributes[:tags].size
27
+ end
28
+ end
29
+
30
+ it "should have the correct tag names" do
31
+ @posts.each do |post|
32
+ post.tags.map(&:name).should == post.attributes[:tags]
33
+ end
34
+ end
35
+
36
+
37
+
38
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tumblargh::Resource do
4
+
5
+ describe "using local data" do
6
+
7
+ before do
8
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
9
+ @json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
10
+ end
11
+
12
+ it "should not have to fall back to the API" do
13
+ Tumblargh::API.disable!
14
+
15
+ blog = Tumblargh::Resource::Blog.new("staff.tumblr.com", @json)
16
+ lambda { blog.posts }.should_not raise_error
17
+
18
+ Tumblargh::API.enable!
19
+ end
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'rspec'
2
+ require 'open-uri'
3
+
4
+ # if something??!
5
+ # require 'simplecov'
6
+ # SimpleCov.start
7
+ # end
8
+
9
+ $: << File.dirname(__FILE__) + '/../lib'
10
+
11
+ require 'tumblargh'
12
+
13
+ FIXTURE_PATH = File.join(File.dirname(__FILE__), 'fixtures')
14
+ TUMBLR_API_KEY = '8QoLnQy4lP0rn6QHNYSDxmhZo0L6xelNmNosAVj703FNfLBhZQ'
15
+
16
+ # Requires supporting files with custom matchers and macros, etc,
17
+ # in ./support/ and its subdirectories.
18
+ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
19
+
20
+ RSpec.configure do |config|
21
+
22
+ config.color_enabled = true
23
+
24
+ end
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tumblargh do
4
+
5
+ describe "specifying the source blog/data" do
6
+
7
+ it "should work with local blog data from a file" do
8
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
9
+
10
+ blog = Tumblargh.send(:create_blog, json_path)
11
+
12
+ blog.should be_an_instance_of Tumblargh::Resource::Blog
13
+ blog.title.should eql "Tumblr Staff"
14
+ end
15
+
16
+ it "should work when passing in a hash" do
17
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
18
+ json = ActiveSupport::JSON.decode(open(json_path).read)
19
+
20
+ blog = Tumblargh.send(:create_blog, json)
21
+
22
+ blog.should be_an_instance_of Tumblargh::Resource::Blog
23
+ blog.title.should eql "Tumblr Staff"
24
+ end
25
+
26
+ it "should work when passing in a Blog object" do
27
+ json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
28
+ json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
29
+ obj = Tumblargh::Resource::Blog.new("#{json["blog"]["name"]}.tumblr.com", json)
30
+
31
+ blog = Tumblargh.send(:create_blog, obj)
32
+
33
+ blog.should be_an_instance_of Tumblargh::Resource::Blog
34
+ blog.title.should eql "Tumblr Staff"
35
+ end
36
+
37
+ it "should work by simply passing a tumblr domain" do
38
+ Tumblargh::API.set_api_key TUMBLR_API_KEY
39
+
40
+ blog = Tumblargh.send(:create_blog, "staff.tumblr.com")
41
+
42
+ blog.should be_an_instance_of Tumblargh::Resource::Blog
43
+ blog.title.should eql "Tumblr Staff"
44
+
45
+ Tumblargh::API.set_api_key nil
46
+ end
47
+
48
+ end
49
+
50
+ end
data/tumblargh.gemspec ADDED
@@ -0,0 +1,120 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "tumblargh"
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jason Webster"]
12
+ s.date = "2012-05-06"
13
+ s.description = "# Tumblargh\n## Groan-less Tumblr theme development\n\n### What is this thing, and why should I care?\n\nIf you've ever had to build a Tumblr theme, you've probably cried out in pain \nwhile tweaking locally, copying, pasting into the theme editor, saving, switching\ntabs and finally refreshing and waiting for your tesing blog to reload.\n\nTumblargh aims to reduce suffering involved with building a theme by offering \na way to fully develop, lint and test Tumblr themes locally, with real posts \nfrom any existing Tumblog.\n\n### Getting Started\n\nYou'll need to get an OAuth consumer key for the Tumblr v2 API to use remote data\nwith Tumblargh. Registration is simple enough, just go to http://www.tumblr.com/oauth/apps\nand fill out the form. Any time Tumblargh asks for your API key, it'll be the \nOAuth Consumer key provided there.\n\n#### Middleman\n\nThe recommended way to use tumblargh is in conjuction with \n[Middleman](http://middlemanapp.com/).\n\n> Middleman is a static site generator based on Sinatra. Providing dozens of \ntemplating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more).\n\nTumblargh includes a simple Middleman extension that turns any Middleman project\ninto a local Tumblr theme building machine.\n\nTumblargh will automatically parse any html files served by Middleman, and \npopulate them with content from the Tumblr of your choosing. It will not\nparse any HTML during Middleman's build process. The output of`middleman build` \nis ready for use on your blog, or submission to the Tumblr theme store.\n\nTo get up an running with Middleman, first create a new Middleman project:\n\n```\n$ middleman init MY_PROJECT_NAME\n```\n\nIf one does not already exist, create a Gemfile and add the following as needed:\n\n```ruby\nsource \"http://rubygems.org\"\n\ngem 'middleman'\ngem 'tumblargh', :git => 'git://github.com/jasonwebster/tumblargh.git'\n```\n\nNote that there has not yet been an official release of tumblargh to RubyGems,\nso currently, specifying the gem via git is necessary.\n\nRun `bundle install`.\n\nThe bare minimum setup in your Middleman config.rb is:\n\n```ruby\nrequire 'tumblargh'\nrequire 'middleman/features/tumblargh'\n\nactivate :tumblargh\n\nset_tumblr_api_key 'API KEY' # This is your OAuth consumer key\nset_tumblr_blog 'staff.tumblr.com'\n```\n\nIt is highly recommended to run the Middleman server via `bundle exec`.\n\n#### Rack\n\nSee `examples/config.ru` for a minimal Rack setup, ready to go with `rackup` or\nyour Ruby server of choice.\n\n### Known issues & planned features\n\n- Source attribution `{block:ContentSource}`\n- Your likes `{block:Likes}`\n- Twitter integration `{block:Twitter}`\n- Custom page support\n\n\n\n"
14
+ s.email = "jason@metalabdesign.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE",
25
+ "README.md",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "examples/confg.ru",
29
+ "examples/middleman_config.rb",
30
+ "lib/middleman/features/tumblargh.rb",
31
+ "lib/rack/tumblargh.rb",
32
+ "lib/tumblargh.rb",
33
+ "lib/tumblargh/api.rb",
34
+ "lib/tumblargh/grammar.rb",
35
+ "lib/tumblargh/grammar.treetop",
36
+ "lib/tumblargh/node.rb",
37
+ "lib/tumblargh/node/base.rb",
38
+ "lib/tumblargh/node/block.rb",
39
+ "lib/tumblargh/node/block_end.rb",
40
+ "lib/tumblargh/node/block_start.rb",
41
+ "lib/tumblargh/node/literal.rb",
42
+ "lib/tumblargh/node/root.rb",
43
+ "lib/tumblargh/node/tag.rb",
44
+ "lib/tumblargh/parser.rb",
45
+ "lib/tumblargh/renderer.rb",
46
+ "lib/tumblargh/renderer/base.rb",
47
+ "lib/tumblargh/renderer/blocks/answer.rb",
48
+ "lib/tumblargh/renderer/blocks/audio.rb",
49
+ "lib/tumblargh/renderer/blocks/base.rb",
50
+ "lib/tumblargh/renderer/blocks/dates.rb",
51
+ "lib/tumblargh/renderer/blocks/navigation.rb",
52
+ "lib/tumblargh/renderer/blocks/notes.rb",
53
+ "lib/tumblargh/renderer/blocks/posts.rb",
54
+ "lib/tumblargh/renderer/blocks/reblogs.rb",
55
+ "lib/tumblargh/renderer/blocks/tags.rb",
56
+ "lib/tumblargh/renderer/document.rb",
57
+ "lib/tumblargh/renderer/literal.rb",
58
+ "lib/tumblargh/renderer/tag.rb",
59
+ "lib/tumblargh/resource.rb",
60
+ "lib/tumblargh/resource/base.rb",
61
+ "lib/tumblargh/resource/blog.rb",
62
+ "lib/tumblargh/resource/note.rb",
63
+ "lib/tumblargh/resource/post.rb",
64
+ "lib/tumblargh/resource/tag.rb",
65
+ "lib/tumblargh/resource/user.rb",
66
+ "spec/api_spec.rb",
67
+ "spec/fixtures/data/staff.tumblr.com-2012-05-06/posts.json",
68
+ "spec/fixtures/themes/fluid.html",
69
+ "spec/fixtures/themes/solstice.html",
70
+ "spec/parser_spec.rb",
71
+ "spec/renderer/blocks/posts_spec.rb",
72
+ "spec/renderer/document_spec.rb",
73
+ "spec/resource/post_spec.rb",
74
+ "spec/resource_spec.rb",
75
+ "spec/spec_helper.rb",
76
+ "spec/tumblargh_spec.rb",
77
+ "tumblargh.gemspec"
78
+ ]
79
+ s.homepage = "http://github.com/jasonwebster/tumblargh"
80
+ s.require_paths = ["lib"]
81
+ s.rubygems_version = "1.8.11"
82
+ s.summary = "Groan-less Tumblr theme development."
83
+
84
+ if s.respond_to? :specification_version then
85
+ s.specification_version = 3
86
+
87
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
88
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.1"])
89
+ s.add_runtime_dependency(%q<treetop>, [">= 0"])
90
+ s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
91
+ s.add_runtime_dependency(%q<api_cache>, [">= 0"])
92
+ s.add_development_dependency(%q<autotest-standalone>, [">= 0"])
93
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
94
+ s.add_development_dependency(%q<rake>, [">= 0"])
95
+ s.add_development_dependency(%q<rspec>, [">= 0"])
96
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
97
+ else
98
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
99
+ s.add_dependency(%q<treetop>, [">= 0"])
100
+ s.add_dependency(%q<nokogiri>, [">= 0"])
101
+ s.add_dependency(%q<api_cache>, [">= 0"])
102
+ s.add_dependency(%q<autotest-standalone>, [">= 0"])
103
+ s.add_dependency(%q<jeweler>, [">= 0"])
104
+ s.add_dependency(%q<rake>, [">= 0"])
105
+ s.add_dependency(%q<rspec>, [">= 0"])
106
+ s.add_dependency(%q<simplecov>, [">= 0"])
107
+ end
108
+ else
109
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
110
+ s.add_dependency(%q<treetop>, [">= 0"])
111
+ s.add_dependency(%q<nokogiri>, [">= 0"])
112
+ s.add_dependency(%q<api_cache>, [">= 0"])
113
+ s.add_dependency(%q<autotest-standalone>, [">= 0"])
114
+ s.add_dependency(%q<jeweler>, [">= 0"])
115
+ s.add_dependency(%q<rake>, [">= 0"])
116
+ s.add_dependency(%q<rspec>, [">= 0"])
117
+ s.add_dependency(%q<simplecov>, [">= 0"])
118
+ end
119
+ end
120
+
metadata ADDED
@@ -0,0 +1,237 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tumblargh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jason Webster
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: &70185562167220 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70185562167220
25
+ - !ruby/object:Gem::Dependency
26
+ name: treetop
27
+ requirement: &70185562166660 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70185562166660
36
+ - !ruby/object:Gem::Dependency
37
+ name: nokogiri
38
+ requirement: &70185562166060 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70185562166060
47
+ - !ruby/object:Gem::Dependency
48
+ name: api_cache
49
+ requirement: &70185562165540 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70185562165540
58
+ - !ruby/object:Gem::Dependency
59
+ name: autotest-standalone
60
+ requirement: &70185562165020 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70185562165020
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: &70185562164520 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70185562164520
80
+ - !ruby/object:Gem::Dependency
81
+ name: rake
82
+ requirement: &70185562163940 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *70185562163940
91
+ - !ruby/object:Gem::Dependency
92
+ name: rspec
93
+ requirement: &70185562163140 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *70185562163140
102
+ - !ruby/object:Gem::Dependency
103
+ name: simplecov
104
+ requirement: &70185562162340 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *70185562162340
113
+ description: ! "# Tumblargh\n## Groan-less Tumblr theme development\n\n### What is
114
+ this thing, and why should I care?\n\nIf you've ever had to build a Tumblr theme,
115
+ you've probably cried out in pain \nwhile tweaking locally, copying, pasting into
116
+ the theme editor, saving, switching\ntabs and finally refreshing and waiting for
117
+ your tesing blog to reload.\n\nTumblargh aims to reduce suffering involved with
118
+ building a theme by offering \na way to fully develop, lint and test Tumblr themes
119
+ locally, with real posts \nfrom any existing Tumblog.\n\n### Getting Started\n\nYou'll
120
+ need to get an OAuth consumer key for the Tumblr v2 API to use remote data\nwith
121
+ Tumblargh. Registration is simple enough, just go to http://www.tumblr.com/oauth/apps\nand
122
+ fill out the form. Any time Tumblargh asks for your API key, it'll be the \nOAuth
123
+ Consumer key provided there.\n\n#### Middleman\n\nThe recommended way to use tumblargh
124
+ is in conjuction with \n[Middleman](http://middlemanapp.com/).\n\n> Middleman is
125
+ a static site generator based on Sinatra. Providing dozens of \ntemplating languages
126
+ (Haml, Sass, Compass, Slim, CoffeeScript, and more).\n\nTumblargh includes a simple
127
+ Middleman extension that turns any Middleman project\ninto a local Tumblr theme
128
+ building machine.\n\nTumblargh will automatically parse any html files served by
129
+ Middleman, and \npopulate them with content from the Tumblr of your choosing. It
130
+ will not\nparse any HTML during Middleman's build process. The output of`middleman
131
+ build` \nis ready for use on your blog, or submission to the Tumblr theme store.\n\nTo
132
+ get up an running with Middleman, first create a new Middleman project:\n\n```\n$
133
+ middleman init MY_PROJECT_NAME\n```\n\nIf one does not already exist, create a Gemfile
134
+ and add the following as needed:\n\n```ruby\nsource \"http://rubygems.org\"\n\ngem
135
+ 'middleman'\ngem 'tumblargh', :git => 'git://github.com/jasonwebster/tumblargh.git'\n```\n\nNote
136
+ that there has not yet been an official release of tumblargh to RubyGems,\nso currently,
137
+ specifying the gem via git is necessary.\n\nRun `bundle install`.\n\nThe bare minimum
138
+ setup in your Middleman config.rb is:\n\n```ruby\nrequire 'tumblargh'\nrequire 'middleman/features/tumblargh'\n\nactivate
139
+ :tumblargh\n\nset_tumblr_api_key 'API KEY' # This is your OAuth consumer key\nset_tumblr_blog
140
+ 'staff.tumblr.com'\n```\n\nIt is highly recommended to run the Middleman server
141
+ via `bundle exec`.\n\n#### Rack\n\nSee `examples/config.ru` for a minimal Rack setup,
142
+ ready to go with `rackup` or\nyour Ruby server of choice.\n\n### Known issues &
143
+ planned features\n\n- Source attribution `{block:ContentSource}`\n- Your likes `{block:Likes}`\n-
144
+ Twitter integration `{block:Twitter}`\n- Custom page support\n\n\n\n"
145
+ email: jason@metalabdesign.com
146
+ executables: []
147
+ extensions: []
148
+ extra_rdoc_files:
149
+ - LICENSE
150
+ - README.md
151
+ files:
152
+ - .gitignore
153
+ - .rspec
154
+ - Gemfile
155
+ - Gemfile.lock
156
+ - LICENSE
157
+ - README.md
158
+ - Rakefile
159
+ - VERSION
160
+ - examples/confg.ru
161
+ - examples/middleman_config.rb
162
+ - lib/middleman/features/tumblargh.rb
163
+ - lib/rack/tumblargh.rb
164
+ - lib/tumblargh.rb
165
+ - lib/tumblargh/api.rb
166
+ - lib/tumblargh/grammar.rb
167
+ - lib/tumblargh/grammar.treetop
168
+ - lib/tumblargh/node.rb
169
+ - lib/tumblargh/node/base.rb
170
+ - lib/tumblargh/node/block.rb
171
+ - lib/tumblargh/node/block_end.rb
172
+ - lib/tumblargh/node/block_start.rb
173
+ - lib/tumblargh/node/literal.rb
174
+ - lib/tumblargh/node/root.rb
175
+ - lib/tumblargh/node/tag.rb
176
+ - lib/tumblargh/parser.rb
177
+ - lib/tumblargh/renderer.rb
178
+ - lib/tumblargh/renderer/base.rb
179
+ - lib/tumblargh/renderer/blocks/answer.rb
180
+ - lib/tumblargh/renderer/blocks/audio.rb
181
+ - lib/tumblargh/renderer/blocks/base.rb
182
+ - lib/tumblargh/renderer/blocks/dates.rb
183
+ - lib/tumblargh/renderer/blocks/navigation.rb
184
+ - lib/tumblargh/renderer/blocks/notes.rb
185
+ - lib/tumblargh/renderer/blocks/posts.rb
186
+ - lib/tumblargh/renderer/blocks/reblogs.rb
187
+ - lib/tumblargh/renderer/blocks/tags.rb
188
+ - lib/tumblargh/renderer/document.rb
189
+ - lib/tumblargh/renderer/literal.rb
190
+ - lib/tumblargh/renderer/tag.rb
191
+ - lib/tumblargh/resource.rb
192
+ - lib/tumblargh/resource/base.rb
193
+ - lib/tumblargh/resource/blog.rb
194
+ - lib/tumblargh/resource/note.rb
195
+ - lib/tumblargh/resource/post.rb
196
+ - lib/tumblargh/resource/tag.rb
197
+ - lib/tumblargh/resource/user.rb
198
+ - spec/api_spec.rb
199
+ - spec/fixtures/data/staff.tumblr.com-2012-05-06/posts.json
200
+ - spec/fixtures/themes/fluid.html
201
+ - spec/fixtures/themes/solstice.html
202
+ - spec/parser_spec.rb
203
+ - spec/renderer/blocks/posts_spec.rb
204
+ - spec/renderer/document_spec.rb
205
+ - spec/resource/post_spec.rb
206
+ - spec/resource_spec.rb
207
+ - spec/spec_helper.rb
208
+ - spec/tumblargh_spec.rb
209
+ - tumblargh.gemspec
210
+ homepage: http://github.com/jasonwebster/tumblargh
211
+ licenses: []
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ segments:
223
+ - 0
224
+ hash: 3569421539013978115
225
+ required_rubygems_version: !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ requirements: []
232
+ rubyforge_project:
233
+ rubygems_version: 1.8.11
234
+ signing_key:
235
+ specification_version: 3
236
+ summary: Groan-less Tumblr theme development.
237
+ test_files: []