visionmedia-mini 0.0.5 → 0.0.6
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/History.rdoc +5 -0
- data/bin/mini +16 -21
- data/mini.gemspec +1 -1
- metadata +1 -1
data/History.rdoc
CHANGED
data/bin/mini
CHANGED
@@ -6,13 +6,9 @@ require 'commander'
|
|
6
6
|
require 'bind'
|
7
7
|
|
8
8
|
program :name, 'mini'
|
9
|
-
program :version, '0.0.
|
9
|
+
program :version, '0.0.6'
|
10
10
|
program :description, 'Github project page framework'
|
11
11
|
|
12
|
-
def html_error message
|
13
|
-
%(<div class="error">#{message}</div>)
|
14
|
-
end
|
15
|
-
|
16
12
|
def current_branch
|
17
13
|
`git branch | grep '*' | awk '{print $2}'`.strip
|
18
14
|
end
|
@@ -55,22 +51,15 @@ command :refresh do |c|
|
|
55
51
|
c.example 'Refresh Firefox and Safari to foo.html once compiled', 'mini refresh foo --browsers Safari,Firefox'
|
56
52
|
c.option '-b', '--browsers BROWSERS', Array, 'List browsers to refresh. Defaults to Safari'
|
57
53
|
c.when_called do |args, options|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
listener.run!
|
68
|
-
rescue => e
|
69
|
-
File.open("#{page}.html", 'w+') do |file|
|
70
|
-
file.write html_error(e.message)
|
71
|
-
end
|
72
|
-
raise
|
73
|
-
end
|
54
|
+
actions = []
|
55
|
+
page = args.shift || 'index'
|
56
|
+
uri = File.join Dir.getwd, "#{page}.html"
|
57
|
+
browsers = options.browsers || ['Safari']
|
58
|
+
haml = Dir["assets/**/*.haml"]
|
59
|
+
sass = Dir["assets/**/*.sass"]
|
60
|
+
actions << CompileHaml.new(uri, *browsers)
|
61
|
+
listener = Bind::Listener.new :interval => 1, :debug => $stdout, :actions => actions, :paths => haml + sass
|
62
|
+
listener.run!
|
74
63
|
end
|
75
64
|
end
|
76
65
|
|
@@ -98,3 +87,9 @@ command :init do |c|
|
|
98
87
|
end
|
99
88
|
end
|
100
89
|
|
90
|
+
command :edit do |c|
|
91
|
+
c.syntax = 'mini edit'
|
92
|
+
c.summary = 'Alias for `git checkout gh-pages`'
|
93
|
+
c.when_called { `git checkout gh-pages` }
|
94
|
+
end
|
95
|
+
|
data/mini.gemspec
CHANGED