mtrack 1.1.1 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 439de667b6c0b7f7ce61aebbd7c2a24c0641ab26
4
- data.tar.gz: 4cf4a18d41e844776342e8ae68c212dc5c4e45c5
3
+ metadata.gz: e7e65f515296198e42617b8a6310e5972b86fa5b
4
+ data.tar.gz: 70911119c9524b644cfe508c188ade1ed1c1190b
5
5
  SHA512:
6
- metadata.gz: f91c1d16d72215d057e442ef805a9d0d5289f2a7226589bad09225c2c9caf96dfa6fa05637b633c3358d1fcf5298634b5eb3bdb3f4e948360b16f661c8f19de5
7
- data.tar.gz: 5a34517412d35c0ba3e03124920bacb39f6812a67d9311598bc5233827ce8d3b918adb3e424c19cf4bd64080fa6e557aa11af75b6b2512271904f923261ee899
6
+ metadata.gz: a4b53ae6efa5206816f90afb16068cfd00a6e3e1bad8e08d170b02337f93291341673de1d7e1842325927ef81e6a7470c014afe46719736a4d46379286d00564
7
+ data.tar.gz: 010a939bdfb9e349a159765b78fa4612e36be6ed899d239de9dc472e84b1fb914be2a2ee7d8400420f6c8705d59ab7413348e1ca332636f32490a2f5b9134509
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ Metrics/LineLength:
3
3
  Style/AndOr:
4
4
  EnforcedStyle: conditionals
5
5
  Style/HashSyntax:
6
- EnforcedStyle: hash_rockets
6
+ EnforcedStyle: ruby19
7
7
  Style/SpaceInsideBlockBraces:
8
8
  SpaceBeforeBlockParameters: false
9
9
  Style/StringLiterals:
data/.travis.yml CHANGED
@@ -5,10 +5,9 @@ rvm:
5
5
  - 2.0
6
6
  - 1.9.3
7
7
  - 1.9.2
8
- - 1.8.7
9
8
  - jruby-head
10
9
  - jruby-1.7
11
- - jruby-1.6
10
+ - rbx
12
11
  bundler_args: "--without development"
13
12
  addons:
14
13
  code_climate:
data/Gemfile CHANGED
@@ -3,16 +3,16 @@ gemspec
3
3
 
4
4
  group :development do
5
5
  gem "byebug", "~> 3.5.1"
6
- gem "guard-rspec", "~> 4.3.1"
6
+ gem "guard-rspec", "~> 4.5.0"
7
7
  gem "guard-rubocop", "~> 1.2.0"
8
- gem "libnotify", "~> 0.8.4"
8
+ gem "libnotify", "~> 0.9.0"
9
9
  gem "pry", "~> 0.10.1"
10
- gem "rubocop", "~> 0.27.1"
10
+ gem "rubocop", "~> 0.28.0"
11
11
  end
12
12
 
13
13
  group :development, :test do
14
- gem "codeclimate-test-reporter", "~> 0.4.1"
15
- gem "rake", "~> 10.4.0"
14
+ gem "codeclimate-test-reporter", "~> 0.4.3"
15
+ gem "rake", "~> 10.4.2"
16
16
  gem "rspec", "~> 3.1.0"
17
17
  gem "simplecov", "~> 0.9.1"
18
18
  end
data/Guardfile CHANGED
@@ -1,12 +1,12 @@
1
- guard :rspec, :cmd => "rspec -fd" do
2
- watch(/^spec\/.+_spec\.rb$/)
3
- watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch("spec/spec_helper.rb") { "spec" }
5
- end
6
-
7
- guard :rubocop do
1
+ guard :rubocop, all_on_start: false do
8
2
  watch(/^.+\.rb$/)
9
3
  watch(/^(?:.+\/)?\.rubocop\.yml$/) {|m| File.dirname(m[0]) }
10
4
  watch(/^(?:.+\/)?.+\.gemspec$/)
11
5
  watch(/^(?:.+\/)?(?:Gem|Rake)file$/)
12
6
  end
7
+
8
+ guard :rspec, cmd: "bundle exec rspec -fd" do
9
+ watch(/^spec\/.+_spec\.rb$/)
10
+ watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }
11
+ watch("spec/spec_helper.rb") { "spec" }
12
+ end
data/README.md CHANGED
@@ -13,9 +13,8 @@
13
13
  [gemnasium]: https://gemnasium.com/gdeoliveira/mtrack#development-dependencies
14
14
  [inch-ci]: http://inch-ci.org/github/gdeoliveira/mtrack
15
15
 
16
- MTrack extends the functionality of Modules and Classes and enables them to
17
- define public methods within groups. These methods can then be queried back even
18
- through a hierarchy of inclusion and/or inheritance.
16
+ MTrack extends the functionality of Modules and Classes and enables them to define public methods within groups. These
17
+ methods can then be queried back even through a hierarchy of inclusion and/or inheritance.
19
18
 
20
19
  ## Installation
21
20
 
@@ -105,8 +104,7 @@ MySubClass.tracked_methods :integers #=> #<Set: {:one, :three, :two, :four}>
105
104
 
106
105
  ### Simple State Machine
107
106
 
108
- We'll create a simple state machine using MTrack. First, let's create an
109
- abstraction for the state machine.
107
+ We'll create a simple state machine using MTrack. First, let's create an abstraction for the state machine.
110
108
 
111
109
  ```ruby
112
110
  require "mtrack"
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  RSpec::Core::RakeTask.new(:spec)
9
9
 
10
- task :default => :coverage
10
+ task default: :coverage
data/lib/mtrack/mixin.rb CHANGED
@@ -36,7 +36,7 @@ module MTrack
36
36
  #
37
37
  # Returns a set with the result.
38
38
  def newly_defined_methods(mod, old_methods)
39
- (mod.public_instance_methods(false) - old_methods).map(&:to_sym).to_set
39
+ (mod.public_instance_methods(false) - old_methods).to_set
40
40
  end
41
41
 
42
42
  ##
@@ -76,8 +76,6 @@ module MTrack
76
76
  end
77
77
  end
78
78
 
79
- public
80
-
81
79
  ##
82
80
  # call-seq:
83
81
  # tracked_methods(group_name = nil) => set
@@ -20,5 +20,5 @@
20
20
  # D.tracked_methods #=> #<Set: {:method_1, :method_2, :method_3}>
21
21
  module MTrack
22
22
  # Current version of MTrack.
23
- VERSION = "1.1.1"
23
+ VERSION = "2.0.0"
24
24
  end
data/mtrack.gemspec CHANGED
@@ -4,22 +4,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require "mtrack/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "mtrack"
8
- spec.version = MTrack::VERSION
9
- spec.authors = ["Gabriel de Oliveira"]
10
- spec.email = ["deoliveira.gab@gmail.com"]
11
- spec.summary = "Group and track methods on classes and modules."
12
- spec.description = <<-EOS.strip.gsub(/\n/, "").gsub(/\s{2,}/, " ")
13
- MTrack extends the functionality of modules and
14
- classes and enables them to define public methods
15
- within groups. These methods can then be queried back
16
- even through a hierarchy of inclusion and/or
17
- inheritance.
18
- EOS
19
- spec.homepage = "https://github.com/gdeoliveira/mtrack"
20
- spec.license = "MIT"
21
-
22
- spec.files = `git ls-files -z`.split("\x0")
23
- spec.test_files = spec.files.grep(/^(test|spec|features)\//)
7
+ spec.required_ruby_version = ">= 1.9"
8
+ spec.name = "mtrack"
9
+ spec.version = MTrack::VERSION
10
+ spec.authors = ["Gabriel de Oliveira"]
11
+ spec.email = ["deoliveira.gab@gmail.com"]
12
+ spec.summary = "Group and track methods on classes and modules."
13
+ spec.description = <<-EOS
14
+ MTrack extends the functionality of modules and classes and enables them to define public methods within groups. These
15
+ methods can then be queried back even through a hierarchy of inclusion and/or inheritance.
16
+ EOS
17
+ spec.homepage = "https://github.com/gdeoliveira/mtrack"
18
+ spec.license = "MIT"
19
+ spec.files = `git ls-files -z`.split("\x0")
20
+ spec.test_files = spec.files.grep(/^(test|spec|features)\//)
24
21
  spec.require_paths = ["lib"]
22
+ spec.rdoc_options << "--title=MTrack"
25
23
  end
@@ -6,9 +6,9 @@ describe MTrack::Mixin do
6
6
  describe "#track_methods" do
7
7
  it "is added after extending #{described_class}" do
8
8
  mod = ::Module.new
9
- expect(mod.private_methods.map(&:to_sym)).not_to include(:track_methods)
9
+ expect(mod.private_methods).not_to include(:track_methods)
10
10
  mod.module_eval { extend MTrack::Mixin }
11
- expect(mod.private_methods.map(&:to_sym)).to include(:track_methods)
11
+ expect(mod.private_methods).to include(:track_methods)
12
12
  end
13
13
 
14
14
  context "no block given" do
@@ -191,7 +191,7 @@ describe MTrack::Mixin do
191
191
  end
192
192
 
193
193
  it "has custom extensions as ancestors" do
194
- expect(subject.singleton_methods.map(&:to_sym)).to include(:base_extension_1_meth, :sub_extension_meth)
194
+ expect(subject.singleton_methods).to include(:base_extension_1_meth, :sub_extension_meth)
195
195
  end
196
196
  end
197
197
 
@@ -219,7 +219,7 @@ describe MTrack::Mixin do
219
219
  end
220
220
 
221
221
  it "has custom extensions as ancestors" do
222
- expect(subject.singleton_methods.map(&:to_sym)).to include(:base_extension_2_meth)
222
+ expect(subject.singleton_methods).to include(:base_extension_2_meth)
223
223
  end
224
224
  end
225
225
 
@@ -395,7 +395,7 @@ describe MTrack::Mixin do
395
395
  end
396
396
  end.to raise_error(RuntimeError, "Unexpected error")
397
397
 
398
- expect(m.public_instance_methods(false).map(&:to_sym)).to match_array([:meth_1, :meth_2])
398
+ expect(m.public_instance_methods(false)).to match_array([:meth_1, :meth_2])
399
399
  expect(m.tracked_methods).to match_array([:meth_1, :meth_2])
400
400
  end
401
401
  end
@@ -415,7 +415,7 @@ describe MTrack::Mixin do
415
415
  end
416
416
  end.to raise_error(RuntimeError, "Unexpected error")
417
417
 
418
- expect(c.public_instance_methods(false).map(&:to_sym)).to match_array([:meth_1, :meth_2])
418
+ expect(c.public_instance_methods(false)).to match_array([:meth_1, :meth_2])
419
419
  expect(c.tracked_methods).to match_array([:meth_1, :meth_2])
420
420
  end
421
421
  end
@@ -2,13 +2,13 @@ require "spec_helper"
2
2
 
3
3
  describe MTrack::State do
4
4
  let(:sample_group) do
5
- { :con_1 => { :tracked => [:trk_1, :trk_2] },
6
- :con_2 => { :tracked => [:trk_2, :trk_3] }
5
+ { con_1: { tracked: [:trk_1, :trk_2] },
6
+ con_2: { tracked: [:trk_2, :trk_3] }
7
7
  }
8
8
  end
9
9
  let(:sample_group_2) do
10
- { :con_2 => { :tracked => [:trk_3, :trk_4] },
11
- :con_3 => { :tracked => [:trk_4, :trk_5] }
10
+ { con_2: { tracked: [:trk_3, :trk_4] },
11
+ con_3: { tracked: [:trk_4, :trk_5] }
12
12
  }
13
13
  end
14
14
 
data/tasks/console.rb CHANGED
@@ -14,19 +14,11 @@ task :console do
14
14
  end
15
15
  end
16
16
 
17
- if RUBY_VERSION >= "1.9"
18
- begin
19
- require "pry"
20
- rescue LoadError
21
- require "irb"
22
- end
23
- else
24
- require "irb"
25
- end
26
-
27
- if defined? Pry
17
+ begin
18
+ require "pry"
28
19
  Pry.start
29
- else
20
+ rescue LoadError
21
+ require "irb"
30
22
  ARGV.clear
31
23
  IRB.start
32
24
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel de Oliveira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-30 00:00:00.000000000 Z
11
+ date: 2014-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: MTrack extends the functionality of modules and classes and enables them
14
- to define public methods within groups. These methods can then be queried back even
15
- through a hierarchy of inclusion and/or inheritance.
13
+ description: |
14
+ MTrack extends the functionality of modules and classes and enables them to define public methods within groups. These
15
+ methods can then be queried back even through a hierarchy of inclusion and/or inheritance.
16
16
  email:
17
17
  - deoliveira.gab@gmail.com
18
18
  executables: []
@@ -48,14 +48,15 @@ licenses:
48
48
  - MIT
49
49
  metadata: {}
50
50
  post_install_message:
51
- rdoc_options: []
51
+ rdoc_options:
52
+ - "--title=MTrack"
52
53
  require_paths:
53
54
  - lib
54
55
  required_ruby_version: !ruby/object:Gem::Requirement
55
56
  requirements:
56
57
  - - ">="
57
58
  - !ruby/object:Gem::Version
58
- version: '0'
59
+ version: '1.9'
59
60
  required_rubygems_version: !ruby/object:Gem::Requirement
60
61
  requirements:
61
62
  - - ">="
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  version: '0'
64
65
  requirements: []
65
66
  rubyforge_project:
66
- rubygems_version: 2.4.4
67
+ rubygems_version: 2.4.5
67
68
  signing_key:
68
69
  specification_version: 4
69
70
  summary: Group and track methods on classes and modules.