nm 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +75 -0
- data/Rakefile +1 -0
- data/lib/nm/version.rb +3 -0
- data/lib/nm.rb +4 -0
- data/log/.gitkeep +0 -0
- data/nm.gemspec +23 -0
- data/test/helper.rb +8 -0
- data/tmp/.gitkeep +0 -0
- metadata +92 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014-Present Kelly Redding and Collin Redding
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Nm
|
2
|
+
|
3
|
+
JSON/BSON data structure template system. Named for its two template methods: "node" and "map".
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Template:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
# in views/slideshow.json.nm
|
11
|
+
|
12
|
+
node 'slideshow' do
|
13
|
+
node 'start_slide', start_slide
|
14
|
+
node 'slides' do
|
15
|
+
map slides do |slide|
|
16
|
+
node 'id', slide.id
|
17
|
+
node 'title', slide.title
|
18
|
+
node 'image', slide.image_url
|
19
|
+
node 'thumb', slide.thumb_url
|
20
|
+
node 'url', slide.url
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
```
|
25
|
+
|
26
|
+
Output:
|
27
|
+
|
28
|
+
```json
|
29
|
+
{ "slideshow": {
|
30
|
+
"start_slide": 1,
|
31
|
+
"slides": [
|
32
|
+
{ "id": "slide-1",
|
33
|
+
"title": "Slide 1",
|
34
|
+
"thumb": "//path/to/slide-1-thumb.jpg",
|
35
|
+
"image": "//path/to/slide-1-image.jpg",
|
36
|
+
"url": "//path/to/slide-1-url",
|
37
|
+
},
|
38
|
+
{ "id": "slide-2",
|
39
|
+
"title": "Slide 2",
|
40
|
+
"thumb": "//path/to/slide-2-thumb.jpg",
|
41
|
+
"image": "//path/to/slide-2-image.jpg",
|
42
|
+
"url": "//path/to/slide-2-url",
|
43
|
+
},
|
44
|
+
{ "id": "slide-3",
|
45
|
+
"title": "Slide 3",
|
46
|
+
"thumb": "//path/to/slide-3-thumb.jpg",
|
47
|
+
"image": "//path/to/slide-3-image.jpg",
|
48
|
+
"url": "//path/to/slide-3-url",
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
52
|
+
}
|
53
|
+
```
|
54
|
+
|
55
|
+
## Installation
|
56
|
+
|
57
|
+
Add this line to your application's Gemfile:
|
58
|
+
|
59
|
+
gem 'nm'
|
60
|
+
|
61
|
+
And then execute:
|
62
|
+
|
63
|
+
$ bundle
|
64
|
+
|
65
|
+
Or install it yourself as:
|
66
|
+
|
67
|
+
$ gem install nm
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
1. Fork it
|
72
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
74
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/nm/version.rb
ADDED
data/lib/nm.rb
ADDED
data/log/.gitkeep
ADDED
File without changes
|
data/nm.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "nm/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "nm"
|
8
|
+
gem.version = Nm::VERSION
|
9
|
+
gem.authors = ["Kelly Redding", "Collin Redding"]
|
10
|
+
gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
|
11
|
+
gem.description = %q{JSON/BSON data structure template system }
|
12
|
+
gem.summary = %q{JSON/BSON data structure template system }
|
13
|
+
gem.homepage = "http://github.com/redding/nm"
|
14
|
+
gem.license = 'MIT'
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.10"])
|
22
|
+
|
23
|
+
end
|
data/test/helper.rb
ADDED
data/tmp/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nm
|
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
|
+
- Kelly Redding
|
14
|
+
- Collin Redding
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2014-04-12 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :development
|
23
|
+
name: assert
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 10
|
33
|
+
version: "2.10"
|
34
|
+
prerelease: false
|
35
|
+
requirement: *id001
|
36
|
+
description: "JSON/BSON data structure template system "
|
37
|
+
email:
|
38
|
+
- kelly@kellyredding.com
|
39
|
+
- collin.redding@me.com
|
40
|
+
executables: []
|
41
|
+
|
42
|
+
extensions: []
|
43
|
+
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
46
|
+
files:
|
47
|
+
- .gitignore
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE.txt
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- lib/nm.rb
|
53
|
+
- lib/nm/version.rb
|
54
|
+
- log/.gitkeep
|
55
|
+
- nm.gemspec
|
56
|
+
- test/helper.rb
|
57
|
+
- tmp/.gitkeep
|
58
|
+
homepage: http://github.com/redding/nm
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
requirements: []
|
85
|
+
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 1.8.15
|
88
|
+
signing_key:
|
89
|
+
specification_version: 3
|
90
|
+
summary: JSON/BSON data structure template system
|
91
|
+
test_files:
|
92
|
+
- test/helper.rb
|