padrino-jbuilder 0.0.1 → 0.0.3

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.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 TODO: Write your name
1
+ Copyright (c) 2012 Andrew Janssen
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Padrino::Jbuilder
2
2
 
3
- TODO: Write a gem description
3
+ Adds the jbuilder templating engine to Padrino
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,10 +16,6 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install padrino-jbuilder
18
18
 
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
19
  ## Contributing
24
20
 
25
21
  1. Fork it
@@ -1,5 +1,5 @@
1
1
  module Padrino
2
2
  module Jbuilder
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -2,6 +2,34 @@ require "padrino-jbuilder/version"
2
2
 
3
3
  module Padrino
4
4
  module Jbuilder
5
- # Your code goes here...
5
+
6
6
  end
7
7
  end
8
+
9
+ # Register
10
+ throw "Padrino not defined" unless defined? Padrino
11
+ throw "Tilt not defined" unless defined? Tilt
12
+ require 'padrino-core'
13
+
14
+ Padrino.after_load {
15
+ class JbuilderTiltTemplate < Tilt::Template
16
+ self.default_mime_type = "application/json"
17
+
18
+ def initialize_engine
19
+ return if defined? Jbuilder
20
+ require_template_library "jbuilder"
21
+ end
22
+
23
+ def prepare
24
+ options = @options.merge(:format => @options[:format], :source_location => file)
25
+ @jbuilder = ::Jbuilder.new
26
+ end
27
+
28
+ def evaluate(scope, locals)
29
+ filename = self.file
30
+ scope.instance_eval File.open(filename).read
31
+ end
32
+ end
33
+
34
+ Tilt.register 'jbuilder', JbuilderTiltTemplate
35
+ }
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in padrino-jbuilder.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Padrino::Jbuilder
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'padrino-jbuilder'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install padrino-jbuilder
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ module Padrino
2
+ module Jbuilder
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "padrino-jbuilder/version"
2
+
3
+ module Padrino
4
+ module Jbuilder
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/padrino-jbuilder/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["TODO: Write your name"]
6
+ gem.email = ["TODO: Write your email address"]
7
+ gem.description = %q{TODO: Write a gem description}
8
+ gem.summary = %q{TODO: Write a gem summary}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "padrino-jbuilder"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Padrino::Jbuilder::VERSION
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: padrino
@@ -58,6 +58,14 @@ files:
58
58
  - lib/padrino-jbuilder.rb
59
59
  - lib/padrino-jbuilder/version.rb
60
60
  - padrino-jbuilder.gemspec
61
+ - padrino-jbuilder/.gitignore
62
+ - padrino-jbuilder/Gemfile
63
+ - padrino-jbuilder/LICENSE
64
+ - padrino-jbuilder/README.md
65
+ - padrino-jbuilder/Rakefile
66
+ - padrino-jbuilder/lib/padrino-jbuilder.rb
67
+ - padrino-jbuilder/lib/padrino-jbuilder/version.rb
68
+ - padrino-jbuilder/padrino-jbuilder.gemspec
61
69
  homepage: https://github.com/thecurator/padrino-jbuilder
62
70
  licenses: []
63
71
  post_install_message:
@@ -83,3 +91,4 @@ signing_key:
83
91
  specification_version: 3
84
92
  summary: Adds the jbuilder templating engine to Padrino
85
93
  test_files: []
94
+ has_rdoc: