ai_tagger 0.2.1 → 0.3.0

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: 8f727c68aa7738a880afd228abf6a656d2dc3915
4
- data.tar.gz: 8f88300c92f0e17c97d450b1d21f7e1bb04c0cae
3
+ metadata.gz: 28cd66b6a289b50ec784d7bbbdf8a7b7e70d3310
4
+ data.tar.gz: 1317e16e5cc585456c0e8087beb2fdb7ef543323
5
5
  SHA512:
6
- metadata.gz: cabb4e299d18f2cb60fd06d2026c0a5be110fbf964139912121789473b0bd90a9388a3a05cecf55c1d9cbb7a8ec7306fc2443398f8d06ffc8dc6223cf1e5054e
7
- data.tar.gz: 98d3f8bbc5b7cf2bb4cd4a3f188b3a26691e28b694ab1e61070e2ab9f918ea0cb064927021ad73d9c7f2b955e568445468e0b39218f4c4e7833609fd8fd3dc5c
6
+ metadata.gz: ba87e502c3a7ddc95a1c043a8d871f5de7487f78580891b500891a61f5b8461ab51c06cca38158dabf09cd44ca0d3eee1217d67e8a45b0b81730a18ea76da33d
7
+ data.tar.gz: c32bb7b4e8374043ea4e09cc8a95092e3818867119d12c3c3c3e52d6e7bf18f9d43fc7e85b8cd01edf05d4651dac56c8f88b1d6a7fa1f221ecf80b80d61d9c35
data/Gemfile.lock CHANGED
@@ -1,13 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ai_tagger (0.2.1)
4
+ ai_tagger (0.3.0)
5
+ activemodel (~> 4.2.11.1)
5
6
  activesupport (~> 4.2.11.1)
6
7
  thor (~> 0.20.3)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
12
+ activemodel (4.2.11.1)
13
+ activesupport (= 4.2.11.1)
14
+ builder (~> 3.1)
11
15
  activesupport (4.2.11.1)
12
16
  i18n (~> 0.7)
13
17
  minitest (~> 5.1)
@@ -15,6 +19,7 @@ GEM
15
19
  tzinfo (~> 1.1)
16
20
  addressable (2.6.0)
17
21
  public_suffix (>= 2.0.2, < 4.0)
22
+ builder (3.2.3)
18
23
  concurrent-ruby (1.1.5)
19
24
  crack (0.4.3)
20
25
  safe_yaml (~> 1.0.0)
data/lib/tagger.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "active_support"
2
+ require "active_model"
2
3
  require "open-uri"
3
4
  require "csv"
4
5
  require "erb"
data/lib/tagger/cli.rb CHANGED
@@ -12,14 +12,11 @@ module Tagger
12
12
 
13
13
  # Parse CSV
14
14
  raw_file = CSV.parse(csv, headers: true)
15
- events = raw_file.map do |row|
16
- event_name = row[1]
17
- if event_name.nil?
18
- nil
19
- else
20
- Tagger::Event.new(event_name)
21
- end
22
- end.compact
15
+ events = raw_file.map { |row|
16
+ Tagger::Event.new(name: row[1])
17
+ }.select { |event|
18
+ event.valid?
19
+ }
23
20
 
24
21
  generator = Tagger::Generator.new(events, options[:platform].to_sym)
25
22
  generator.generate(options[:out])
data/lib/tagger/event.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  module Tagger
2
2
  class Event
3
+ include ActiveModel::Model
3
4
  attr_accessor :name
4
-
5
- def initialize(name)
6
- @name = name
7
- end
5
+ validates :name, presence: true
6
+ validates :name, length: { maximum: 40 }
8
7
  end
9
8
  end
@@ -1,3 +1,3 @@
1
1
  module Tagger
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/tagger.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.require_paths = ["lib"]
37
37
 
38
38
  spec.add_dependency "activesupport", "~> 4.2.11.1"
39
+ spec.add_dependency "activemodel", "~> 4.2.11.1"
39
40
  spec.add_dependency "thor", "~> 0.20.3"
40
41
 
41
42
  spec.add_development_dependency "bundler", "~> 2.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai_tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.11.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: activemodel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.11.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 4.2.11.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: thor
29
43
  requirement: !ruby/object:Gem::Requirement