packlist 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ require 'packlist/model'
2
+ require 'packlist/utils'
3
+ require 'packlist/template'
4
+
5
+ module PackList
6
+ class Report
7
+ include GemUtils
8
+
9
+ def initialize(packlist)
10
+ @packlist = packlist
11
+ @template = Template.new templates_path('packlist'), 'report'
12
+ end
13
+
14
+ def save_to(filename)
15
+ @template.render_to filename, {packlist: @packlist}
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,55 @@
1
+ require 'padrino-helpers'
2
+ require 'sinatra'
3
+
4
+ module PackList
5
+ class Template
6
+ include Sinatra::Templates
7
+ include Padrino::Rendering
8
+ include Padrino::Helpers::RenderHelpers
9
+ attr_reader :template_cache
10
+
11
+ def initialize(templates_path, template_file_name)
12
+ @template_cache = Tilt::Cache.new
13
+ @template_file_name = template_file_name
14
+ settings.views = templates_path
15
+ end
16
+
17
+ def render_to(filename, data)
18
+ File.open(filename, 'w') do |file|
19
+ file.write(generate data)
20
+ end
21
+ end
22
+
23
+ def generate(data)
24
+ render(@template_file_name, locals: data)
25
+ end
26
+
27
+ def settings
28
+ self.class
29
+ end
30
+
31
+ def self.reload_templates?
32
+ true
33
+ end
34
+
35
+ def self.views=(value)
36
+ @_views = value
37
+ end
38
+
39
+ def self.views
40
+ @_views
41
+ end
42
+
43
+ def self.set(name, value)
44
+ self.class.instance_eval{ define_method(name) { value } unless method_defined?(:erb) }
45
+ end
46
+
47
+ def self.default_encoding
48
+ "utf-8"
49
+ end
50
+
51
+ def self.templates
52
+ {}
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,20 @@
1
+ module PackList
2
+ module GemUtils
3
+ def gem_path(gem)
4
+ Gem::Specification.find_by_name(gem).gem_dir
5
+ end
6
+
7
+ def assets_path(gem, asset_type)
8
+ File.join(gem_path(gem), 'app', 'assets', asset_type)
9
+ end
10
+
11
+
12
+ def stylesheets_path(gem)
13
+ assets_path(gem, 'stylesheets')
14
+ end
15
+
16
+ def templates_path(gem)
17
+ assets_path(gem, 'templates')
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module Packlist
2
+ VERSION = "0.9.0"
3
+ end
data/packlist.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'packlist/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "packlist"
8
+ spec.version = Packlist::VERSION
9
+ spec.authors = ["Jim Cushing"]
10
+ spec.email = ["jimothy@mac.com"]
11
+
12
+ spec.summary = "Create gear lists for your next backpacking adventure."
13
+ spec.description = "Create gear lists for your next backpacking adventure."
14
+ # spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency 'sass'
23
+ spec.add_dependency 'sinatra'
24
+ spec.add_dependency 'padrino-helpers', '~> 0.13.2'
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.9"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "minitest", "~> 5.0"
30
+ spec.add_development_dependency "coveralls", "~> 0.8"
31
+ end
data/test.html ADDED
@@ -0,0 +1,81 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Bootstrap Column Test</title>
5
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
6
+ <style type="text/css">
7
+ .container .row div {
8
+ padding: 3em;
9
+ background: #ddd;
10
+ border: solid 1px black;
11
+ }
12
+
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <div class="container">
17
+ <div class="row">
18
+ <div class="col-md-1">.col-md-1</div>
19
+ <div class="col-md-1">.col-md-1 fasdfousa dsasdf sdfa</div>
20
+ <div class="col-md-1">.col-md-1</div>
21
+ <div class="col-md-1">.col-md-1</div>
22
+ <div class="col-md-1">.col-md-1</div>
23
+ <div class="col-md-1">.col-md-1</div>
24
+ <div class="col-md-1">.col-md-1</div>
25
+ <div class="col-md-1">.col-md-1</div>
26
+ <div class="col-md-1">.col-md-1</div>
27
+ <div class="col-md-1">.col-md-1</div>
28
+ <div class="col-md-1">.col-md-1</div>
29
+ <div class="col-md-1">.col-md-1</div>
30
+ <div class="col-md-1">.col-md-1</div>
31
+ <div class="col-md-1">.col-md-1 fasdfousa dsasdf sdfa</div>
32
+ <div class="col-md-1">.col-md-1</div>
33
+ <div class="col-md-1">.col-md-1</div>
34
+ <div class="col-md-1">.col-md-1</div>
35
+ <div class="col-md-1">.col-md-1</div>
36
+ <div class="col-md-1">.col-md-1</div>
37
+ <div class="col-md-1">.col-md-1</div>
38
+ <div class="col-md-1">.col-md-1</div>
39
+ <div class="col-md-1">.col-md-1</div>
40
+ <div class="col-md-1">.col-md-1</div>
41
+ <div class="col-md-1">.col-md-1</div>
42
+ <div class="col-md-1">.col-md-1</div>
43
+ <div class="col-md-1">.col-md-1 fasdfousa dsasdf sdfa</div>
44
+ <div class="col-md-1">.col-md-1</div>
45
+ <div class="col-md-1">.col-md-1</div>
46
+ <div class="col-md-1">.col-md-1</div>
47
+ <div class="col-md-1">.col-md-1</div>
48
+ <div class="col-md-1">.col-md-1</div>
49
+ <div class="col-md-1">.col-md-1</div>
50
+ <div class="col-md-1">.col-md-1</div>
51
+ <div class="col-md-1">.col-md-1</div>
52
+ <div class="col-md-1">.col-md-1</div>
53
+ <div class="col-md-1">.col-md-1</div>
54
+ <div class="col-md-1">.col-md-1</div>
55
+ <div class="col-md-1">.col-md-1 fasdfousa dsasdf sdfa</div>
56
+ <div class="col-md-1">.col-md-1</div>
57
+ <div class="col-md-1">.col-md-1</div>
58
+ <div class="col-md-1">.col-md-1</div>
59
+ <div class="col-md-1">.col-md-1</div>
60
+ <div class="col-md-1">.col-md-1</div>
61
+ <div class="col-md-1">.col-md-1</div>
62
+ <div class="col-md-1">.col-md-1</div>
63
+ <div class="col-md-1">.col-md-1</div>
64
+ <div class="col-md-1">.col-md-1</div>
65
+ <div class="col-md-1">.col-md-1</div>
66
+ <div class="col-md-1">.col-md-1</div>
67
+ <div class="col-md-1">.col-md-1 fasdfousa dsasdf sdfa</div>
68
+ <div class="col-md-1">.col-md-1</div>
69
+ <div class="col-md-1">.col-md-1</div>
70
+ <div class="col-md-1">.col-md-1</div>
71
+ <div class="col-md-1">.col-md-1</div>
72
+ <div class="col-md-1">.col-md-1</div>
73
+ <div class="col-md-1">.col-md-1</div>
74
+ <div class="col-md-1">.col-md-1</div>
75
+ <div class="col-md-1">.col-md-1</div>
76
+ <div class="col-md-1">.col-md-1</div>
77
+ <div class="col-md-1">.col-md-1</div>
78
+ </div>
79
+ </div>
80
+ </body>
81
+ </html>
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: packlist
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ platform: ruby
6
+ authors:
7
+ - Jim Cushing
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: padrino-helpers
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.13.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.13.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.9'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.9'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '5.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.8'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.8'
125
+ description: Create gear lists for your next backpacking adventure.
126
+ email:
127
+ - jimothy@mac.com
128
+ executables:
129
+ - packlist
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - ".gitignore"
134
+ - Gemfile
135
+ - LICENSE.txt
136
+ - README.md
137
+ - Rakefile
138
+ - app/assets/images/_consumed.svg.erb
139
+ - app/assets/images/_worn.svg.erb
140
+ - app/assets/stylesheets/_report.scss
141
+ - app/assets/stylesheets/_system-font.scss
142
+ - app/assets/stylesheets/styles.scss
143
+ - app/assets/templates/report.html.erb
144
+ - bin/console
145
+ - bin/setup
146
+ - docs/sample_pack.png
147
+ - docs/sample_pack.rb
148
+ - exe/packlist
149
+ - lib/packlist.rb
150
+ - lib/packlist/dsl.rb
151
+ - lib/packlist/model.rb
152
+ - lib/packlist/report.rb
153
+ - lib/packlist/template.rb
154
+ - lib/packlist/utils.rb
155
+ - lib/packlist/version.rb
156
+ - packlist.gemspec
157
+ - test.html
158
+ homepage:
159
+ licenses:
160
+ - MIT
161
+ metadata: {}
162
+ post_install_message:
163
+ rdoc_options: []
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.4.5.1
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: Create gear lists for your next backpacking adventure.
182
+ test_files: []