ddplugin 0.1 → 1.0.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: 0de5a9e0217483b21eacdc6668deb299a6dd3e06
4
- data.tar.gz: 2e1afa6aed108a66552d3b2e65ecde95cddd838f
3
+ metadata.gz: 1cb5ed133200502a15fec93f8b2058ed7a01008b
4
+ data.tar.gz: d24a3bb4dd0d7ebfda7b34ab5b41afc40d4afe28
5
5
  SHA512:
6
- metadata.gz: 68d16f23635d03879c49c1322c006a023157292ea6f1844bae05c2bba59f7d6c3e315a54799668c5ba43b98f3ec087f51d57cd27c3f5f366a973a6ad24078626
7
- data.tar.gz: fa3a128aac7969bced4dbaf7248871d604fb2e15b97c205a014be6c3d0dc61e62a53026c41c6467ad05fa4a2216de0fc2f3dd1fb988f2c642ce0d82631745295
6
+ metadata.gz: c21e116c84b17e3d7f90e9b9f3115f19700da029f6d0a56236ab003f4c49e733488ca61f0a7039a1b8cb1176bbe5997e1b56ed2eae016528c75d87c4e793f1d9
7
+ data.tar.gz: 18fe5cd2da62d2cfa01f28d3e1531356f077e5495abc20f2c9f8356752c48a06ffafa068330f10c6b2b6b862fef4753b31671a8f72b38bfd8043163ed7514cbe
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
  gem 'minitest'
6
6
  gem 'rake'
7
7
  gem 'coveralls', require: false
8
+ gem 'rubocop'
data/Gemfile.lock CHANGED
@@ -1,40 +1,54 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ddplugin (0.1)
4
+ ddplugin (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- coveralls (0.7.0)
10
- multi_json (~> 1.3)
11
- rest-client
12
- simplecov (>= 0.7)
13
- term-ansicolor
14
- thor
15
- docile (1.1.1)
16
- mime-types (2.0)
17
- minitest (5.0.8)
18
- multi_json (1.8.2)
19
- rake (10.1.0)
20
- rest-client (1.6.7)
21
- mime-types (>= 1.16)
22
- simplecov (0.8.2)
9
+ ast (2.3.0)
10
+ coveralls (0.8.16)
11
+ json (>= 1.8, < 3)
12
+ simplecov (~> 0.12.0)
13
+ term-ansicolor (~> 1.3.0)
14
+ thor (~> 0.19.1)
15
+ tins (>= 1.6.0, < 2)
16
+ docile (1.1.5)
17
+ json (2.0.2)
18
+ minitest (5.9.1)
19
+ parser (2.3.2.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.1.0)
23
+ rake (11.3.0)
24
+ rubocop (0.45.0)
25
+ parser (>= 2.3.1.1, < 3.0)
26
+ powerpack (~> 0.1)
27
+ rainbow (>= 1.99.1, < 3.0)
28
+ ruby-progressbar (~> 1.7)
29
+ unicode-display_width (~> 1.0, >= 1.0.1)
30
+ ruby-progressbar (1.8.1)
31
+ simplecov (0.12.0)
23
32
  docile (~> 1.1.0)
24
- multi_json
25
- simplecov-html (~> 0.8.0)
26
- simplecov-html (0.8.0)
27
- term-ansicolor (1.2.2)
28
- tins (~> 0.8)
29
- thor (0.18.1)
30
- tins (0.13.1)
33
+ json (>= 1.8, < 3)
34
+ simplecov-html (~> 0.10.0)
35
+ simplecov-html (0.10.0)
36
+ term-ansicolor (1.3.2)
37
+ tins (~> 1.0)
38
+ thor (0.19.3)
39
+ tins (1.13.0)
40
+ unicode-display_width (1.1.1)
31
41
 
32
42
  PLATFORMS
33
43
  ruby
34
44
 
35
45
  DEPENDENCIES
36
- bundler
46
+ bundler (~> 1.13)
37
47
  coveralls
38
48
  ddplugin!
39
49
  minitest
40
50
  rake
51
+ rubocop
52
+
53
+ BUNDLED WITH
54
+ 1.13.6
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  [![Build Status](https://travis-ci.org/ddfreyne/ddplugin.png)](https://travis-ci.org/ddfreyne/ddplugin)
2
2
  [![Code Climate](https://codeclimate.com/github/ddfreyne/ddplugin.png)](https://codeclimate.com/github/ddfreyne/ddplugin)
3
3
  [![Coverage Status](https://coveralls.io/repos/ddfreyne/ddplugin/badge.png?branch=master)](https://coveralls.io/r/ddfreyne/ddplugin)
4
+ [![Inline docs](http://inch-ci.org/github/ddfreyne/ddplugin.png)](http://inch-ci.org/github/ddfreyne/ddplugin)
4
5
 
5
6
  # ddplugin
6
7
 
@@ -41,7 +42,7 @@ A typical way to use plugins would be to store the plugin names in a configurati
41
42
  If your library where you want to use *ddplugin* has a gemspec, add *ddplugin* as a runtime dependency to the gemspec:
42
43
 
43
44
  ```ruby
44
- spec.add_runtime_dependency 'ddplugin' '~> 1.0'
45
+ spec.add_runtime_dependency 'ddplugin', '~> 1.0'
45
46
  ```
46
47
 
47
48
  If you use Bundler instead, add it to the `Gemfile`:
data/Rakefile CHANGED
@@ -1,10 +1,14 @@
1
- # encoding: utf-8
2
-
3
1
  require 'rake/testtask'
2
+ require 'rubocop/rake_task'
4
3
 
5
4
  Rake::TestTask.new do |t|
6
5
  t.libs = %w( lib test )
7
6
  t.test_files = FileList['test/**/test_*.rb', 'test/**/*_spec.rb']
8
7
  end
9
8
 
10
- task :default => :test
9
+ RuboCop::RakeTask.new do |task|
10
+ task.options = %w(--display-cop-names --format simple)
11
+ task.patterns = ['lib/**/*.rb', 'test/**/*.rb']
12
+ end
13
+
14
+ task :default => [:test, :rubocop]
data/ddplugin.gemspec CHANGED
@@ -1,7 +1,4 @@
1
- # encoding: utf-8
2
-
3
- $LOAD_PATH.unshift(File.expand_path('../lib/', __FILE__))
4
- require 'ddplugin/version'
1
+ require_relative 'lib/ddplugin/version'
5
2
 
6
3
  Gem::Specification.new do |s|
7
4
  s.name = 'ddplugin'
@@ -14,7 +11,7 @@ Gem::Specification.new do |s|
14
11
  s.email = 'denis.defreyne@stoneship.org'
15
12
  s.license = 'MIT'
16
13
 
17
- s.required_ruby_version = '>= 1.9.3'
14
+ s.required_ruby_version = '>= 2.1.0'
18
15
 
19
16
  s.files = Dir['[A-Z]*'] +
20
17
  Dir['{lib,test}/**/*'] +
@@ -24,5 +21,5 @@ Gem::Specification.new do |s|
24
21
  s.rdoc_options = [ '--main', 'README.md' ]
25
22
  s.extra_rdoc_files = [ 'LICENSE', 'README.md', 'NEWS.md' ]
26
23
 
27
- s.add_development_dependency('bundler')
24
+ s.add_development_dependency('bundler', '~> 1.13')
28
25
  end
@@ -1,12 +1,8 @@
1
- # encoding: utf-8
2
-
3
1
  module DDPlugin
4
-
5
2
  # A module that contains class methods for plugins. It provides functions
6
3
  # for setting identifiers and finding plugins. Plugin classes should extend
7
4
  # this module.
8
5
  module Plugin
9
-
10
6
  # @overload identifiers(*identifiers)
11
7
  #
12
8
  # Sets the identifiers for this class.
@@ -45,11 +41,11 @@ module DDPlugin
45
41
  # @overload identifier
46
42
  #
47
43
  # @return [Symbol] The first identifier for this class
48
- def identifier(identifier=nil)
44
+ def identifier(identifier = nil)
49
45
  if identifier
50
- self.identifiers(identifier)
46
+ identifiers(identifier)
51
47
  else
52
- self.identifiers.first
48
+ identifiers.first
53
49
  end
54
50
  end
55
51
 
@@ -64,7 +60,5 @@ module DDPlugin
64
60
  def named(identifier)
65
61
  DDPlugin::Registry.instance.find(self, identifier)
66
62
  end
67
-
68
63
  end
69
-
70
64
  end
@@ -1,22 +1,18 @@
1
- # encoding: utf-8
2
-
3
1
  module DDPlugin
4
-
5
2
  # The registry is responsible for keeping track of all loaded plugins.
6
3
  class Registry
7
-
8
4
  # Returns the shared {DDPlugin::Registry} instance, creating it if none
9
5
  # exists yet.
10
6
  #
11
7
  # @return [DDPlugin::Registry] The shared plugin registry
12
8
  def self.instance
13
- @instance ||= self.new
9
+ @instance ||= new
14
10
  end
15
11
 
16
12
  # @api private
17
13
  def initialize
18
- @identifiers_to_classes = Hash.new { |h,k| h[k] = {}.dup }
19
- @classes_to_identifiers = Hash.new { |h,k| h[k] = {}.dup }
14
+ @identifiers_to_classes = Hash.new { |h, k| h[k] = {}.dup }
15
+ @classes_to_identifiers = Hash.new { |h, k| h[k] = {}.dup }
20
16
  end
21
17
 
22
18
  # Registers the given class as a plugin.
@@ -70,7 +66,5 @@ module DDPlugin
70
66
  @identifiers_to_classes[root_class] ||= {}
71
67
  @identifiers_to_classes[root_class].values
72
68
  end
73
-
74
69
  end
75
-
76
70
  end
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module DDPlugin
4
-
5
- VERSION = '0.1'
6
-
2
+ VERSION = '1.0.0'.freeze
7
3
  end
data/lib/ddplugin.rb CHANGED
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'ddplugin/version'
4
2
  require 'ddplugin/plugin'
5
3
  require 'ddplugin/registry'
data/test/helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'coveralls'
4
2
  Coveralls.wear!
5
3
 
data/test/test_plugin.rb CHANGED
@@ -1,9 +1,6 @@
1
- # encoding: utf-8
2
-
3
1
  require 'helper'
4
2
 
5
3
  class DDPlugin::PluginTest < Minitest::Test
6
-
7
4
  class IdentifierSample
8
5
  extend DDPlugin::Plugin
9
6
  end
@@ -36,10 +33,10 @@ class DDPlugin::PluginTest < Minitest::Test
36
33
  assert_empty klass.identifiers
37
34
 
38
35
  klass.identifiers :foo1, :foo2
39
- assert_equal [ :foo1, :foo2 ], klass.identifiers
36
+ assert_equal [:foo1, :foo2], klass.identifiers
40
37
 
41
38
  klass.identifiers :bar1, :bar2
42
- assert_equal [ :foo1, :foo2, :bar1, :bar2 ], klass.identifiers
39
+ assert_equal [:foo1, :foo2, :bar1, :bar2], klass.identifiers
43
40
  end
44
41
 
45
42
  def test_root
@@ -53,7 +50,7 @@ class DDPlugin::PluginTest < Minitest::Test
53
50
  assert_equal subklass, InheritanceSample.named(:sub)
54
51
 
55
52
  assert_equal :sub, subklass.identifier
56
- assert_equal [ :sub, :also_sub ], subklass.identifiers
53
+ assert_equal [:sub, :also_sub], subklass.identifiers
57
54
 
58
55
  assert_equal InheritanceSample, superklass.root_class
59
56
  assert_equal InheritanceSample, subklass.root_class
@@ -74,7 +71,6 @@ class DDPlugin::PluginTest < Minitest::Test
74
71
  klass2 = Class.new(AllSample)
75
72
  klass2.identifier :two
76
73
 
77
- assert_equal [ klass1, klass2 ], AllSample.all
74
+ assert_equal [klass1, klass2], AllSample.all
78
75
  end
79
-
80
76
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddplugin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-14 00:00:00.000000000 Z
11
+ date: 2016-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.13'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.13'
27
27
  description: Provides plugin management for Ruby projects
28
28
  email: denis.defreyne@stoneship.org
29
29
  executables: []
@@ -37,15 +37,15 @@ files:
37
37
  - Gemfile.lock
38
38
  - LICENSE
39
39
  - NEWS.md
40
- - Rakefile
41
40
  - README.md
41
+ - Rakefile
42
+ - ddplugin.gemspec
43
+ - lib/ddplugin.rb
42
44
  - lib/ddplugin/plugin.rb
43
45
  - lib/ddplugin/registry.rb
44
46
  - lib/ddplugin/version.rb
45
- - lib/ddplugin.rb
46
47
  - test/helper.rb
47
48
  - test/test_plugin.rb
48
- - ddplugin.gemspec
49
49
  homepage: http://github.com/ddfreyne/ddplugin/
50
50
  licenses:
51
51
  - MIT
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 1.9.3
63
+ version: 2.1.0
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
@@ -68,9 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 2.0.3
71
+ rubygems_version: 2.6.8
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Plugins for Ruby apps
75
75
  test_files: []
76
- has_rdoc: