noft 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/lib/noft/generator.rb +5 -5
- data/noft.gemspec +1 -1
- data/test/helper.rb +1 -1
- data/test/noft/test_generator.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5110aa362dd78790de760fae619152bcfdf8ae4
|
4
|
+
data.tar.gz: 71e8fdcfeb1187f7c7a5a7df372776cb35ca8616
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e215940e0fc372d07c9c818575b82217060855c085088e875076a44cc3a336f6743a6d502092739602a92646f07656aa2e7ce388a4fec54807e7336a6465f5
|
7
|
+
data.tar.gz: b2942af1fd57d15ee63ed6a1cfc870cbd49fc18fc8787b848ec419f9eea536d8325e42150c00b6bb5863ca120dbdbfe1a324bab23e1b350be3533cb86ca857c4
|
data/lib/noft/generator.rb
CHANGED
@@ -45,11 +45,11 @@ module Noft
|
|
45
45
|
wait_until { File.exist?("#{output_directory}/verify.html") }
|
46
46
|
|
47
47
|
FileUtils.rm "#{output_directory}/verify.html"
|
48
|
-
FileUtils.mv "#{output_directory}/source-font.ttf", "#{output_directory}
|
48
|
+
FileUtils.mv "#{output_directory}/source-font.ttf", "#{output_directory}/#{icon_set_name}.ttf"
|
49
49
|
FileUtils.mv Dir["#{output_directory}/svg/*.svg"], output_directory
|
50
50
|
FileUtils.rmdir "#{output_directory}/svg"
|
51
51
|
|
52
|
-
reset_state_if_unchanged(output_directory)
|
52
|
+
reset_state_if_unchanged(icon_set_name, output_directory)
|
53
53
|
|
54
54
|
output_directory
|
55
55
|
end
|
@@ -62,10 +62,10 @@ module Noft
|
|
62
62
|
# scenario just reset the file.
|
63
63
|
# Note: svg2ttf uses current date for some fields even if you pass in a date. Also font-blast
|
64
64
|
# does not pass in a date.
|
65
|
-
def reset_state_if_unchanged(output_directory)
|
65
|
+
def reset_state_if_unchanged(icon_set_name, output_directory)
|
66
66
|
output = `git status -s #{output_directory}`
|
67
|
-
if output.split("\n").size == 1 && !(output =~ /^ M (.*\/)
|
68
|
-
`git checkout #{output_directory}
|
67
|
+
if output.split("\n").size == 1 && !(output =~ /^ M (.*\/)?#{icon_set_name}.ttf$/).nil?
|
68
|
+
`git checkout #{output_directory}/#{icon_set_name}.ttf`
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
data/noft.gemspec
CHANGED
data/test/helper.rb
CHANGED
@@ -117,7 +117,7 @@ class Noft::TestCase < Minitest::Test
|
|
117
117
|
assert_fixture_matches_output("#{fixture_name}/dist/fire-symbol.svg", "#{output_directory}/fire-symbol.svg")
|
118
118
|
assert_fixture_matches_output("#{fixture_name}/dist/sample1.noft.json", "#{output_directory}/sample1.noft.json")
|
119
119
|
|
120
|
-
assert_true File.exist?("#{output_directory}/
|
120
|
+
assert_true File.exist?("#{output_directory}/sample1.ttf")
|
121
121
|
assert_false File.exist?("#{output_directory}/verify.html")
|
122
122
|
assert_false File.exist?("#{output_directory}/source-font.ttf")
|
123
123
|
assert_false File.exist?("#{output_directory}/svg")
|
data/test/noft/test_generator.rb
CHANGED
@@ -18,7 +18,7 @@ class TestGenerator < Noft::TestCase
|
|
18
18
|
|
19
19
|
create_git_repo(git_dir) do |dir|
|
20
20
|
update_dir_from_fixture(output_directory, 'sample1/dist')
|
21
|
-
File.write("#{output_directory}
|
21
|
+
File.write("#{output_directory}/#{icon_set.name}.ttf", 'random_content')
|
22
22
|
end
|
23
23
|
|
24
24
|
Noft::Generator.generate_assets(icon_set.name, output_directory)
|
@@ -34,13 +34,13 @@ class TestGenerator < Noft::TestCase
|
|
34
34
|
git_dir = local_dir('myrepo')
|
35
35
|
create_git_repo(git_dir) do |dir|
|
36
36
|
update_dir_from_fixture(dir, 'sample1')
|
37
|
-
File.write('
|
37
|
+
File.write('sample1.ttf', 'random_content')
|
38
38
|
end
|
39
39
|
|
40
40
|
in_dir(git_dir) do
|
41
|
-
File.write('
|
42
|
-
assert_equal " M
|
43
|
-
Noft::Generator.send(:reset_state_if_unchanged, git_dir)
|
41
|
+
File.write('sample1.ttf', 'other content')
|
42
|
+
assert_equal " M sample1.ttf\n", run_command('git status -s')
|
43
|
+
Noft::Generator.send(:reset_state_if_unchanged, 'sample1', git_dir)
|
44
44
|
assert_equal '', run_command('git status -s')
|
45
45
|
end
|
46
46
|
end
|