fontello_rails_converter 0.4.0 → 0.4.1

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: abdcf7343cc9d7f66ce7ce34fb21014f55ff4a51
4
- data.tar.gz: e58cdb33a77d9dbda843378079739c3429f5081f
3
+ metadata.gz: a5afdb7c6c5608e0f122a1499f94627629404fdd
4
+ data.tar.gz: 609b452ae1eb3c22a070bd33f2a9552375de9e9d
5
5
  SHA512:
6
- metadata.gz: bc89a7f0563e879ceb8fa214890500ff92e1d4c3df0d3b9e8011393aa06b0cf52c2e06c8eebfdb987135297f0494c8897a29af8320fd6a07010a74f4a2706115
7
- data.tar.gz: 5e84b26ebfc5a64b4094dd0a335ddac451c0d41fea50c7dc29a3187d668f9507c3fa94e1ce8ee9903a7fbc23671be27dc70484d9ae290114c3ecb0dcbae472aa
6
+ metadata.gz: 899b64f286cb557adad4f8686755daa6210f49ef17ca28bcf7179c291d5b3c7f783427787972d6f9f36d8231a42077aee13656c62b6ba607bf44d26a23396f00
7
+ data.tar.gz: 0d9de066d925af2234362a9f5e9b6ab6dc2809f51e23b428b8acdd6205304fdd1360345e522f8d6820f12fd467fca7582f8c97c2511ff774240bb41978cac72a
data/.travis.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.2
5
4
  bundler_args: --without development
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
+ # 0.4.1
2
+
3
+ * [bugfix] for case where font name in `config.json` is empty #30
4
+
1
5
  # 0.4.0
2
6
 
3
7
  * added new `copy` command for cases where you don't want to convert assets
8
+ * gem now depends on Ruby 2.x
4
9
 
5
10
  # 0.3.3
6
11
 
data/README.md CHANGED
@@ -16,6 +16,8 @@ Main features:
16
16
 
17
17
  Add the gem to your Gemfile `gem 'fontello_rails_converter'` and run `bundle install`
18
18
 
19
+ Read the [note](https://github.com/railslove/fontello_rails_converter#gemfile-environment) below to decide whether to put the gem into the `production` or `development` group in your Gemfile.
20
+
19
21
  #### Get your icon font
20
22
 
21
23
  1. Download your initial `.zip` file from [http://fontello.com](http://fontello.com) and save it to `myapp/tmp/fontello.zip`
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = '~> 2.0'
22
+
21
23
  spec.add_runtime_dependency "rubyzip", "~> 1.0"
22
24
  spec.add_runtime_dependency "launchy"
23
25
  spec.add_runtime_dependency "rest-client"
@@ -183,7 +183,7 @@ module FontelloRailsConverter
183
183
 
184
184
  def fontello_name
185
185
  @_fontello_name ||= if config_file_exists?
186
- JSON.parse(File.read(@options[:config_file]))['name']
186
+ JSON.parse(File.read(@options[:config_file]))['name'].presence || 'fontello'
187
187
  end
188
188
  end
189
189
  end
@@ -1,3 +1,3 @@
1
1
  module FontelloRailsConverter
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -29,21 +29,29 @@ describe FontelloRailsConverter::Cli do
29
29
  end
30
30
 
31
31
  describe '#fontello_name' do
32
- context 'no config_file set' do
32
+ context 'no config_file specified' do
33
33
  let(:cli) { described_class.new({}) }
34
34
  specify do
35
35
  expect(cli.send(:fontello_name)).to eql nil
36
36
  end
37
37
  end
38
38
 
39
- context 'config file doesnt exist' do
39
+ context 'specified config file doesnt exist' do
40
40
  let(:cli) { described_class.new(config_file: 'foo') }
41
41
  specify do
42
42
  expect(cli.send(:fontello_name)).to eql nil
43
43
  end
44
44
  end
45
45
 
46
+ context 'name is empty' do
47
+ let(:cli) { described_class.new(config_file: 'spec/fixtures/empty_name_config.json') }
48
+ it 'should fall back to "fontello"' do
49
+ expect(cli.send(:fontello_name)).to eql 'fontello'
50
+ end
51
+ end
52
+
46
53
  context 'correct config file' do
54
+
47
55
  specify do
48
56
  expect(cli.send(:fontello_name)).to eql 'makerist'
49
57
  end
@@ -0,0 +1,3 @@
1
+ {
2
+ "name": ""
3
+ }
@@ -5,23 +5,23 @@ describe FontelloRailsConverter::FontelloApi do
5
5
  subject { described_class.new config_file: File.expand_path('../fixtures/minimal-config.json', __FILE__), fontello_session_id_file: File.expand_path('../fixtures/fontello_session_id_persisted', __FILE__) }
6
6
 
7
7
  before do
8
- subject.stub(:persist_session)
8
+ allow(subject).to receive(:persist_session)
9
9
  end
10
10
 
11
11
  describe '#new_session_from_config' do
12
12
  before do
13
- RestClient.should_receive(:post).and_return 'NEWIDFROMCONFIG'
13
+ expect(RestClient).to receive(:post).and_return 'NEWIDFROMCONFIG'
14
14
  end
15
15
 
16
16
  specify do
17
- subject.should_receive(:persist_session)
17
+ expect(subject).to receive(:persist_session)
18
18
  expect(subject.new_session_from_config).to eql 'NEWIDFROMCONFIG'
19
19
  end
20
20
  end
21
21
 
22
22
  describe '#session_url' do
23
23
  before do
24
- subject.should_receive(:session_id).and_return "12345"
24
+ expect(subject).to receive(:session_id).and_return "12345"
25
25
  end
26
26
 
27
27
  specify do
@@ -43,7 +43,7 @@ describe FontelloRailsConverter::FontelloApi do
43
43
  describe '#session_id' do
44
44
  context 'session_id NOT set on initialization' do
45
45
  specify do
46
- subject.should_receive(:read_or_create_session).and_return 'foo'
46
+ expect(subject).to receive(:read_or_create_session).and_return 'foo'
47
47
  expect(subject.send(:session_id)).to eql 'foo'
48
48
  end
49
49
  end
@@ -60,7 +60,7 @@ describe FontelloRailsConverter::FontelloApi do
60
60
  describe '#read_or_create_session' do
61
61
  context 'read from existing file' do
62
62
  specify do
63
- subject.should_not_receive(:new_session_from_config)
63
+ expect(subject).not_to receive(:new_session_from_config)
64
64
  expect(subject.send(:read_or_create_session)).to eql 'MYPERSISTEDSESSION'
65
65
  end
66
66
  end
@@ -71,7 +71,7 @@ describe FontelloRailsConverter::FontelloApi do
71
71
  end
72
72
 
73
73
  specify do
74
- subject.should_receive(:new_session_from_config).and_return 'NEWSESSION'
74
+ expect(subject).to receive(:new_session_from_config).and_return 'NEWSESSION'
75
75
  expect(subject.send(:read_or_create_session)).to eql 'NEWSESSION'
76
76
  end
77
77
  end
@@ -82,7 +82,7 @@ describe FontelloRailsConverter::FontelloApi do
82
82
  end
83
83
 
84
84
  specify do
85
- subject.should_receive(:new_session_from_config).and_return 'NEWSESSION'
85
+ expect(subject).to receive(:new_session_from_config).and_return 'NEWSESSION'
86
86
  expect(subject.send(:read_or_create_session)).to eql 'NEWSESSION'
87
87
  end
88
88
  end
data/spec/spec_helper.rb CHANGED
@@ -6,6 +6,7 @@ require 'fontello_rails_converter'
6
6
  RSpec.configure do |config|
7
7
  config.run_all_when_everything_filtered = true
8
8
  config.filter_run :focus
9
+ config.raise_errors_for_deprecations!
9
10
 
10
11
  config.order = 'random'
11
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontello_rails_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Hilden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -137,6 +137,7 @@ files:
137
137
  - spec/dummy/public/favicon.ico
138
138
  - spec/fixtures/config.json
139
139
  - spec/fixtures/converted/fontello-demo.html
140
+ - spec/fixtures/empty_name_config.json
140
141
  - spec/fixtures/fontello-demo.html
141
142
  - spec/fixtures/fontello_session_id_changing
142
143
  - spec/fixtures/fontello_session_id_empty
@@ -154,9 +155,9 @@ require_paths:
154
155
  - lib
155
156
  required_ruby_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - ">="
158
+ - - "~>"
158
159
  - !ruby/object:Gem::Version
159
- version: '0'
160
+ version: '2.0'
160
161
  required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  requirements:
162
163
  - - ">="
@@ -215,6 +216,7 @@ test_files:
215
216
  - spec/dummy/public/favicon.ico
216
217
  - spec/fixtures/config.json
217
218
  - spec/fixtures/converted/fontello-demo.html
219
+ - spec/fixtures/empty_name_config.json
218
220
  - spec/fixtures/fontello-demo.html
219
221
  - spec/fixtures/fontello_session_id_changing
220
222
  - spec/fixtures/fontello_session_id_empty