gumdrop 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +9 -2
- data/bin/gumdrop +2 -1
- data/gumdrop.gemspec +1 -0
- data/lib/gumdrop.rb +1 -1
- data/lib/gumdrop/cli/external.rb +2 -2
- data/lib/gumdrop/cli/internal.rb +8 -0
- data/lib/gumdrop/util/core_ex.rb +1 -1
- data/lib/gumdrop/util/hash_object.rb +11 -1
- data/lib/gumdrop/util/view_helpers.rb +8 -6
- data/lib/gumdrop/version.rb +1 -1
- data/specs/hash_object_spec.rb +7 -0
- metadata +22 -9
data/ChangeLog.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# v1.0.3
|
2
|
+
- Fixed markdown and textile view_helpers.
|
3
|
+
- `Dir.chdir` to `site.root`. (should be able to run gumdrop in any folder of a Gumdrop project)
|
4
|
+
- Added support for launching the browser when starting the dev server.
|
5
|
+
- You may now override the dev server port on the cli as well.
|
6
|
+
- Disabled automatic `bundle install` when a new project is created. It's annoying.
|
7
|
+
|
1
8
|
# v1.0.2
|
2
9
|
- `gumdrop new` will automatically run `bundle install` so the project site is ready to go.
|
3
10
|
- Using kramdown in default template.
|
@@ -105,7 +112,7 @@
|
|
105
112
|
- You can install the current site as a local template using `gumdrop -t new_template_name` in a site folder.
|
106
113
|
- Data folder path is now configurable: `Gumdrop.config.data_dir` or `set :data_dir, "PATH"`
|
107
114
|
- Added `data.site` and `data.site_all` to `DefferedLoader`. Useful for listing all non-grey-listed files or all files.
|
108
|
-
- Data will now load from data/COLLECTION_NAME/*.
|
115
|
+
- Data will now load from data/COLLECTION_NAME/*.json or .yaml or .yml. Loads as an array array of all entries, adds a key '_id' that's the base filename.
|
109
116
|
- Initial `redirect` options for use in generate blocks.
|
110
117
|
- Extra stitch generator options:
|
111
118
|
- `compress` takes `:jsmin`, `:yuic`, or `:uglify` now. (`true` defaults to `:jsmin`)
|
@@ -171,7 +178,7 @@
|
|
171
178
|
|
172
179
|
# v0.2.14
|
173
180
|
- Added new template type: twitter
|
174
|
-
- Added cli option -t / --template to specify default
|
181
|
+
- Added cli option -t / --template to specify default or twitter template when creating a new project
|
175
182
|
|
176
183
|
# v0.2.13
|
177
184
|
- Adding content_filters for altering rendered output -- BUILD ONLY!
|
data/bin/gumdrop
CHANGED
@@ -10,7 +10,8 @@ Bundler.require if File.exists?('Gemfile')
|
|
10
10
|
begin
|
11
11
|
if Gumdrop.in_site_folder?
|
12
12
|
# Pre-Fetch Site and load Gumdrop file
|
13
|
-
Gumdrop.site
|
13
|
+
Gumdrop.site
|
14
|
+
Dir.chdir Gumdrop.site.root
|
14
15
|
Gumdrop::CLI::Internal.start
|
15
16
|
else
|
16
17
|
Gumdrop::CLI::External.start
|
data/gumdrop.gemspec
CHANGED
data/lib/gumdrop.rb
CHANGED
data/lib/gumdrop/cli/external.rb
CHANGED
data/lib/gumdrop/cli/internal.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'thor'
|
3
|
+
require 'launchy'
|
3
4
|
|
4
5
|
module Gumdrop::CLI
|
5
6
|
class Internal < Thor
|
@@ -25,8 +26,15 @@ module Gumdrop::CLI
|
|
25
26
|
end
|
26
27
|
|
27
28
|
desc 'server', 'Run development server'
|
29
|
+
method_option :browser, aliases:'-b', default:false, desc:"Launch a browser to the site address."
|
30
|
+
method_option :port, aliases:'-p', default:4567, desc:"Port to run the server on."
|
28
31
|
def server
|
32
|
+
Gumdrop.configure do |c|
|
33
|
+
c.server_port= options[:port]
|
34
|
+
end
|
29
35
|
Gumdrop.site.options = options.merge(mode:'server')
|
36
|
+
Launchy.open "http://127.0.0.1:#{ options[:port] }" if options[:browser]
|
37
|
+
Gumdrop.log.warn "Launching dev server at http://127.0.0.1:#{ options[:port] }"
|
30
38
|
Gumdrop::Server
|
31
39
|
end
|
32
40
|
|
data/lib/gumdrop/util/core_ex.rb
CHANGED
@@ -7,6 +7,9 @@ module Gumdrop::Util
|
|
7
7
|
super(key.to_sym)
|
8
8
|
end
|
9
9
|
def []=(key, value)
|
10
|
+
if value.is_a? Hash
|
11
|
+
value= HashObject.from value, true
|
12
|
+
end
|
10
13
|
super(key.to_sym, value)
|
11
14
|
end
|
12
15
|
|
@@ -59,8 +62,15 @@ module Gumdrop::Util
|
|
59
62
|
end
|
60
63
|
end
|
61
64
|
|
62
|
-
def self.from(hash={})
|
65
|
+
def self.from(hash={}, recurse=true)
|
63
66
|
h= new
|
67
|
+
if recurse
|
68
|
+
hash.each do |key, value|
|
69
|
+
if value.is_a? Hash
|
70
|
+
hash[key]= HashObject.from value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
64
74
|
h.merge!(hash)
|
65
75
|
h
|
66
76
|
end
|
@@ -8,18 +8,20 @@ module Gumdrop
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def markdown(source)
|
11
|
-
|
12
|
-
unless
|
13
|
-
eng.new
|
11
|
+
eng_class= Gumdrop::Renderer.for 'markdown'
|
12
|
+
unless eng_class.nil?
|
13
|
+
eng= eng_class.new { source }
|
14
|
+
eng.render
|
14
15
|
else
|
15
16
|
raise StandardError, "Markdown is not available: Include a Markdown engine in your Gemfile!"
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
20
|
def textile(source)
|
20
|
-
|
21
|
-
unless
|
22
|
-
eng.new
|
21
|
+
eng_class= Gumdrop::Renderer.for 'textile'
|
22
|
+
unless eng_class.nil?
|
23
|
+
eng= eng_class.new { source }
|
24
|
+
eng.render
|
23
25
|
else
|
24
26
|
raise StandardError, "Textile is not available: Include a Textile engine in your Gemfile!"
|
25
27
|
end
|
data/lib/gumdrop/version.rb
CHANGED
data/specs/hash_object_spec.rb
CHANGED
@@ -73,4 +73,11 @@ describe Gumdrop::Util::HashObject do
|
|
73
73
|
ho.fifth.must_equal 5
|
74
74
|
end
|
75
75
|
|
76
|
+
it "should make nested hashes act like objects too" do
|
77
|
+
@ho.sub= { :name=>'Matt', 'age'=>'OLDish', 'sub'=>{ 'stuff'=>'STUFF' } }
|
78
|
+
@ho.sub.name.must_equal "Matt"
|
79
|
+
@ho.sub.age.must_equal 'OLDish'
|
80
|
+
@ho.sub.sub.stuff.must_equal 'STUFF'
|
81
|
+
end
|
82
|
+
|
76
83
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 3
|
9
|
+
version: 1.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt McCray
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
type: :runtime
|
97
97
|
version_requirements: *id006
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: launchy
|
100
100
|
prerelease: false
|
101
101
|
requirement: &id007 !ruby/object:Gem::Requirement
|
102
102
|
none: false
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
type: :runtime
|
110
110
|
version_requirements: *id007
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: bundle
|
113
113
|
prerelease: false
|
114
114
|
requirement: &id008 !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
@@ -119,10 +119,10 @@ dependencies:
|
|
119
119
|
segments:
|
120
120
|
- 0
|
121
121
|
version: "0"
|
122
|
-
type: :
|
122
|
+
type: :runtime
|
123
123
|
version_requirements: *id008
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
|
-
name:
|
125
|
+
name: minitest
|
126
126
|
prerelease: false
|
127
127
|
requirement: &id009 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
type: :development
|
136
136
|
version_requirements: *id009
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
|
-
name:
|
138
|
+
name: sqlite3
|
139
139
|
prerelease: false
|
140
140
|
requirement: &id010 !ruby/object:Gem::Requirement
|
141
141
|
none: false
|
@@ -148,7 +148,7 @@ dependencies:
|
|
148
148
|
type: :development
|
149
149
|
version_requirements: *id010
|
150
150
|
- !ruby/object:Gem::Dependency
|
151
|
-
name:
|
151
|
+
name: sprockets
|
152
152
|
prerelease: false
|
153
153
|
requirement: &id011 !ruby/object:Gem::Requirement
|
154
154
|
none: false
|
@@ -161,7 +161,7 @@ dependencies:
|
|
161
161
|
type: :development
|
162
162
|
version_requirements: *id011
|
163
163
|
- !ruby/object:Gem::Dependency
|
164
|
-
name:
|
164
|
+
name: stitch
|
165
165
|
prerelease: false
|
166
166
|
requirement: &id012 !ruby/object:Gem::Requirement
|
167
167
|
none: false
|
@@ -173,6 +173,19 @@ dependencies:
|
|
173
173
|
version: "0"
|
174
174
|
type: :development
|
175
175
|
version_requirements: *id012
|
176
|
+
- !ruby/object:Gem::Dependency
|
177
|
+
name: jsmin
|
178
|
+
prerelease: false
|
179
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
segments:
|
185
|
+
- 0
|
186
|
+
version: "0"
|
187
|
+
type: :development
|
188
|
+
version_requirements: *id013
|
176
189
|
description: The sweet 'n simple cms and prototyping tool for creating static html websites and webapps.
|
177
190
|
email: matt@elucidata.net
|
178
191
|
executables:
|