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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/TODO.md +20 -5
  3. data/lib/fontcustom.rb +42 -4
  4. data/lib/fontcustom/cli.rb +65 -25
  5. data/lib/fontcustom/generator/font.rb +26 -26
  6. data/lib/fontcustom/generator/template.rb +29 -30
  7. data/lib/fontcustom/options.rb +207 -23
  8. data/lib/fontcustom/templates/_fontcustom-bootstrap-ie7.scss +9 -9
  9. data/lib/fontcustom/templates/_fontcustom-bootstrap.scss +19 -19
  10. data/lib/fontcustom/templates/_fontcustom-rails.scss +28 -0
  11. data/lib/fontcustom/templates/_fontcustom.scss +11 -11
  12. data/lib/fontcustom/templates/fontcustom-bootstrap-ie7.css +9 -9
  13. data/lib/fontcustom/templates/fontcustom-bootstrap.css +19 -19
  14. data/lib/fontcustom/templates/fontcustom-preview.html +34 -7
  15. data/lib/fontcustom/templates/fontcustom.css +11 -11
  16. data/lib/fontcustom/templates/fontcustom.yml +11 -6
  17. data/lib/fontcustom/util.rb +38 -159
  18. data/lib/fontcustom/version.rb +1 -1
  19. data/lib/fontcustom/watcher.rb +16 -14
  20. data/spec/fixtures/generators/.fontcustom-data-corrupted +18 -0
  21. data/spec/fixtures/generators/fontcustom.yml +1 -0
  22. data/spec/fixtures/{util/fontcustom.yml → options/any-file-name.yml} +0 -0
  23. data/spec/fixtures/{util → options}/config-is-in-dir/fontcustom.yml +0 -0
  24. data/spec/fixtures/options/fontcustom-empty.yml +1 -0
  25. data/spec/fixtures/{util → options}/fontcustom-malformed.yml +0 -0
  26. data/spec/fixtures/options/fontcustom.yml +1 -0
  27. data/spec/fixtures/options/no-config-here/.gitkeep +0 -0
  28. data/spec/fixtures/{util → options}/rails-like/config/fontcustom.yml +0 -0
  29. data/spec/fontcustom/generator/font_spec.rb +31 -15
  30. data/spec/fontcustom/generator/template_spec.rb +20 -18
  31. data/spec/fontcustom/options_spec.rb +428 -0
  32. data/spec/fontcustom/util_spec.rb +38 -336
  33. data/spec/fontcustom/watcher_spec.rb +7 -2
  34. data/spec/spec_helper.rb +1 -2
  35. metadata +23 -13
  36. data/lib/fontcustom/actions.rb +0 -28
  37. data/spec/fontcustom/actions_spec.rb +0 -22
@@ -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