noft 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5046a3faee66aed725fc9fd130f5f4641c1df224
4
- data.tar.gz: 0dd4f731000397a545c1ac1c3aeb6ee4e8c2c372
3
+ metadata.gz: c5110aa362dd78790de760fae619152bcfdf8ae4
4
+ data.tar.gz: 71e8fdcfeb1187f7c7a5a7df372776cb35ca8616
5
5
  SHA512:
6
- metadata.gz: ce901a034e0ad483cda8e0ad8573faa5063add433d3b01a19093fb6078e8ee8965436f0d46a9005df9efdb9a77e2589e087322b61d5c628718fb08e21c12c18f
7
- data.tar.gz: dae5ef2dd488ccbe81fb00ec1f7ef51617db95fa3a774b5155b62ddb7d3f30b6b6b6bbb873343994aef558279794058a69d5e480df058da349a614433a289f36
6
+ metadata.gz: 12e215940e0fc372d07c9c818575b82217060855c085088e875076a44cc3a336f6743a6d502092739602a92646f07656aa2e7ce388a4fec54807e7336a6465f5
7
+ data.tar.gz: b2942af1fd57d15ee63ed6a1cfc870cbd49fc18fc8787b848ec419f9eea536d8325e42150c00b6bb5863ca120dbdbfe1a324bab23e1b350be3533cb86ca857c4
@@ -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}/font.ttf"
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 (.*\/)?font.ttf$/).nil?
68
- `git checkout #{output_directory}/font.ttf`
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{noft}
5
- s.version = '1.0.1'
5
+ s.version = '1.0.2'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
@@ -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}/font.ttf")
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")
@@ -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}/font.ttf", 'random_content')
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('font.ttf', 'random_content')
37
+ File.write('sample1.ttf', 'random_content')
38
38
  end
39
39
 
40
40
  in_dir(git_dir) do
41
- File.write('font.ttf', 'other content')
42
- assert_equal " M font.ttf\n", run_command('git status -s')
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noft
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald