fontcustom 1.1.0.pre → 1.1.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO.md +20 -5
- data/lib/fontcustom.rb +42 -4
- data/lib/fontcustom/cli.rb +65 -25
- data/lib/fontcustom/generator/font.rb +26 -26
- data/lib/fontcustom/generator/template.rb +29 -30
- data/lib/fontcustom/options.rb +207 -23
- data/lib/fontcustom/templates/_fontcustom-bootstrap-ie7.scss +9 -9
- data/lib/fontcustom/templates/_fontcustom-bootstrap.scss +19 -19
- data/lib/fontcustom/templates/_fontcustom-rails.scss +28 -0
- data/lib/fontcustom/templates/_fontcustom.scss +11 -11
- data/lib/fontcustom/templates/fontcustom-bootstrap-ie7.css +9 -9
- data/lib/fontcustom/templates/fontcustom-bootstrap.css +19 -19
- data/lib/fontcustom/templates/fontcustom-preview.html +34 -7
- data/lib/fontcustom/templates/fontcustom.css +11 -11
- data/lib/fontcustom/templates/fontcustom.yml +11 -6
- data/lib/fontcustom/util.rb +38 -159
- data/lib/fontcustom/version.rb +1 -1
- data/lib/fontcustom/watcher.rb +16 -14
- data/spec/fixtures/generators/.fontcustom-data-corrupted +18 -0
- data/spec/fixtures/generators/fontcustom.yml +1 -0
- data/spec/fixtures/{util/fontcustom.yml → options/any-file-name.yml} +0 -0
- data/spec/fixtures/{util → options}/config-is-in-dir/fontcustom.yml +0 -0
- data/spec/fixtures/options/fontcustom-empty.yml +1 -0
- data/spec/fixtures/{util → options}/fontcustom-malformed.yml +0 -0
- data/spec/fixtures/options/fontcustom.yml +1 -0
- data/spec/fixtures/options/no-config-here/.gitkeep +0 -0
- data/spec/fixtures/{util → options}/rails-like/config/fontcustom.yml +0 -0
- data/spec/fontcustom/generator/font_spec.rb +31 -15
- data/spec/fontcustom/generator/template_spec.rb +20 -18
- data/spec/fontcustom/options_spec.rb +428 -0
- data/spec/fontcustom/util_spec.rb +38 -336
- data/spec/fontcustom/watcher_spec.rb +7 -2
- data/spec/spec_helper.rb +1 -2
- metadata +23 -13
- data/lib/fontcustom/actions.rb +0 -28
- data/spec/fontcustom/actions_spec.rb +0 -22
data/lib/fontcustom/actions.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require "thor/actions"
|
2
|
-
require "thor/shell"
|
3
|
-
require "thor/shell/basic"
|
4
|
-
require "thor/shell/color"
|
5
|
-
|
6
|
-
module Fontcustom
|
7
|
-
module Actions
|
8
|
-
def self.included(base)
|
9
|
-
base.send :include, Thor::Actions
|
10
|
-
end
|
11
|
-
|
12
|
-
# TODO Currently not sure how Thor classes inherit `say_status` from Thor::Shell.
|
13
|
-
# Using the instance variable as a workaround.
|
14
|
-
def say_changed(status, changed)
|
15
|
-
return unless opts[:verbose]
|
16
|
-
message = changed.map do |file|
|
17
|
-
file.gsub!(opts[:project_root], "")
|
18
|
-
file = file[1..-1] if file[0] == "/"
|
19
|
-
file
|
20
|
-
end
|
21
|
-
@shell.say_status status, message.join(" ")
|
22
|
-
end
|
23
|
-
|
24
|
-
def clear_file(file)
|
25
|
-
File.open(file, "w") {}
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Fontcustom::Actions do
|
4
|
-
class Generator
|
5
|
-
include Fontcustom::Actions
|
6
|
-
attr_accessor :opts
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@opts = { :project_root => fixture, :verbose => true }
|
10
|
-
@shell = Thor::Shell::Color.new
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "#say_changed" do
|
15
|
-
it "should strip :project_root from changed paths" do
|
16
|
-
changed = %w|a b c|.map { |file| fixture(file) }
|
17
|
-
gen = Generator.new
|
18
|
-
output = capture(:stdout) { gen.say_changed(:success, changed) }
|
19
|
-
output.should_not match(fixture)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|