dfect 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/inochi.opts ADDED
@@ -0,0 +1,31 @@
1
+ ##
2
+ # Location where project documentation will be uploaded by `inochi pub:doc`.
3
+ # This value can utilize any remote/destination syntax supported by `rsync`.
4
+ #
5
+ :pub_doc_target: ~/www/lib/dfect
6
+
7
+ ##
8
+ # Options for the `rsync` command used to upload this project's documentation.
9
+ #
10
+ :pub_doc_options: --verbose --compress --archive --update --delete
11
+
12
+ ##
13
+ # Arbitrary Ruby code that will configure this project's RubyGem before it
14
+ # is built by `inochi gem`. This code has access to a local variable named
15
+ # `gem` which holds a Gem::Specification object representing this project.
16
+ #
17
+ # @example
18
+ #
19
+ # :gem_spec_logic: |
20
+ # # show the Inochi-provided specification for this project's RubyGem
21
+ # puts gem
22
+ #
23
+ # # add files that are outside this project directory to the RubyGem
24
+ # gem.files += FileList['/some/outside/**/*.files']
25
+ #
26
+ # # omit some files in this project's directory from the RubyGem
27
+ # gem.files.exclude '{some*files,in_this,project/**/directory}'
28
+ #
29
+ # # and so on... anything is possible! use your imagination!
30
+ #
31
+ :gem_spec_logic: |
data/lib/dfect.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'dfect/inochi'
2
+
1
3
  require 'yaml'
2
4
  #
3
5
  # YAML raises this error when we try to serialize a class:
@@ -21,14 +23,7 @@ end
21
23
 
22
24
  # load interactive debugger
23
25
  begin
24
-
25
- begin
26
- require 'rubygems'
27
- rescue LoadError
28
- end
29
-
30
26
  require 'ruby-debug'
31
-
32
27
  rescue LoadError
33
28
  require 'irb'
34
29
  end
data/lib/dfect/inochi.rb CHANGED
@@ -1,48 +1,102 @@
1
1
  module Dfect
2
2
 
3
- INSTDIR = File.expand_path('../../..', __FILE__)
3
+ ##
4
+ # Official name of this project.
5
+ #
6
+ PROJECT = "Dfect"
4
7
 
5
- # load inochi configuration
6
- inochi_file = __FILE__.sub(/rb$/, 'yaml')
7
- begin
8
+ ##
9
+ # Short single-line description of this project.
10
+ #
11
+ TAGLINE = "Assertion testing library for Ruby"
8
12
 
9
- configs = File.open(inochi_file) do |f|
10
- require 'yaml'
11
- YAML.load_stream(f).documents
12
- end
13
+ ##
14
+ # Address of this project's official home page.
15
+ #
16
+ WEBSITE = "http://snk.tuxfamily.org/lib/dfect/"
13
17
 
14
- INOCHI = configs.shift.to_hash
15
- INOCHI[:runtime] ||= {}
16
- INOCHI[:devtime] ||= {}
18
+ ##
19
+ # Number of this release of this project.
20
+ #
21
+ VERSION = "2.1.0"
17
22
 
18
- INOCHI2 = (configs.shift || {}).to_hash
23
+ ##
24
+ # Date of this release of this project.
25
+ #
26
+ RELDATE = "2010-03-31"
19
27
 
20
- rescue => error
21
- error.message.insert 0,
22
- "Could not load Inochi configuration file: #{inochi_file.inspect}\n"
23
- raise error
28
+ ##
29
+ # Description of this release of this project.
30
+ #
31
+ def self.inspect
32
+ "#{PROJECT} #{VERSION} (#{RELDATE})"
24
33
  end
25
34
 
26
- # make values available as constants
27
- INOCHI.each do |param, value|
28
- const_set param.to_s.upcase, value
29
- end
35
+ ##
36
+ # Location of this release of this project.
37
+ #
38
+ INSTDIR = File.expand_path('../../..', __FILE__)
30
39
 
31
- def self.inspect
32
- "#{PROJECT} #{VERSION} (#{RELEASE})"
33
- end
40
+ ##
41
+ # RubyGems required by this project during runtime.
42
+ #
43
+ # @example
44
+ #
45
+ # RUNTIME = {
46
+ # # this project needs exactly version 1.2.3 of the "an_example" gem
47
+ # "an_example" => [ "1.2.3" ],
48
+ #
49
+ # # this project needs at least version 1.2 (but not
50
+ # # version 1.2.4 or newer) of the "another_example" gem
51
+ # "another_example" => [ ">= 1.2" , "< 1.2.4" ],
52
+ #
53
+ # # this project needs any version of the "yet_another_example" gem
54
+ # "yet_another_example" => [],
55
+ # }
56
+ #
57
+ RUNTIME = {}
34
58
 
35
- # establish gem version dependencies
36
- if respond_to? :gem
37
- [:runtime, :devtime].each do |key|
38
- INOCHI[key].each do |gem_name, gem_version|
59
+ ##
60
+ # RubyGems required by this project during development.
61
+ #
62
+ # @example
63
+ #
64
+ # DEVTIME = {
65
+ # # this project needs exactly version 1.2.3 of the "an_example" gem
66
+ # "an_example" => [ "1.2.3" ],
67
+ #
68
+ # # this project needs at least version 1.2 (but not
69
+ # # version 1.2.4 or newer) of the "another_example" gem
70
+ # "another_example" => [ ">= 1.2" , "< 1.2.4" ],
71
+ #
72
+ # # this project needs any version of the "yet_another_example" gem
73
+ # "yet_another_example" => [],
74
+ # }
75
+ #
76
+ DEVTIME = {
77
+ "inochi" => [ "~> 2" ], # for managing this project
78
+ }
79
+
80
+ ##
81
+ # Loads the correct version (as defined by the {RUNTIME} or {DEVTIME}
82
+ # constant in this module) of the given gem or the gem that contains
83
+ # the given library.
84
+ #
85
+ def self.require gem_name_or_library
86
+ # prepare the correct version of the gem for loading
87
+ if respond_to? :gem
88
+ gem_name = gem_name_or_library.to_s.sub(%r{/.*$}, '')
89
+ if gem_version = RUNTIME[gem_name] || DEVTIME[gem_name]
39
90
  begin
40
- gem gem_name, *Array(gem_version)
91
+ gem gem_name, *gem_version
41
92
  rescue LoadError => error
42
- warn "#{inspect} #{key}: #{error}"
93
+ warn "#{self.inspect}: #{error}"
43
94
  end
44
95
  end
45
96
  end
97
+
98
+ # do the loading
99
+ super
46
100
  end
47
101
 
48
102
  end
data/test/dfect_test.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'dfect'
2
+
1
3
  D 'T()' do
2
4
  T { true }
3
5
  T { !false }
metadata CHANGED
@@ -4,42 +4,54 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 2
7
+ - 1
7
8
  - 0
8
- - 0
9
- version: 2.0.0
9
+ version: 2.1.0
10
10
  platform: ruby
11
11
  authors:
12
- - Suraj N. Kurapati <sunaku@gmail.com>
12
+ - Suraj N. Kurapati
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-21 00:00:00 -07:00
17
+ date: 2010-03-31 00:00:00 -07:00
18
18
  default_executable:
19
- dependencies: []
20
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: inochi
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ version: "2"
30
+ type: :development
31
+ version_requirements: *id001
21
32
  description: " Dfect is an assertion testing library for Ruby that\n emphasizes a simple assertion vocabulary, instant\n debuggability of failures, and flexibility in composing\n tests.\n"
22
33
  email:
23
- executables: []
24
-
34
+ executables:
35
+ - dfect
25
36
  extensions: []
26
37
 
27
38
  extra_rdoc_files: []
28
39
 
29
40
  files:
30
41
  - CREDITS
42
+ - inochi.opts
31
43
  - INSTALL
44
+ - MANUAL
32
45
  - test/runner
33
- - test/dfect/inochi_test.rb
34
46
  - test/test_helper.rb
35
47
  - test/dfect_test.rb
36
48
  - lib/dfect/inochi.rb
37
49
  - lib/dfect/auto.rb
38
- - lib/dfect/inochi.yaml
39
50
  - lib/dfect/mini.rb
40
51
  - lib/dfect/unit.rb
41
52
  - lib/dfect/spec.rb
42
53
  - lib/dfect.rb
54
+ - bin/dfect
43
55
  - USAGE
44
56
  - LICENSE
45
57
  - HISTORY
@@ -61,7 +73,6 @@ files:
61
73
  - doc/api/Dfect.html
62
74
  - doc/api/file.LICENSE.html
63
75
  - doc/api/file_list.html
64
- - doc/index.erb
65
76
  has_rdoc: true
66
77
  homepage: http://snk.tuxfamily.org/lib/dfect/
67
78
  licenses: []
data/doc/index.erb DELETED
@@ -1,18 +0,0 @@
1
- % api_reference_url = 'api/index.html'
2
- % api_reference = "[API reference](#{api_reference_url})"
3
- % source_code_tool = '[Git](http://git-scm.com)'
4
- % source_code_url = 'http://github.com/sunaku/dfect'
5
- % issue_tracker_url = 'http://github.com/sunaku/dfect/issues'
6
-
7
- %|part "Welcome"
8
- %+ "../README"
9
-
10
- %|part "Setup"
11
- %+ "../INSTALL"
12
-
13
- %|part "Usage"
14
- %+ "../USAGE"
15
-
16
- %|part "History"
17
- %|project_history
18
- %+ "../HISTORY"
@@ -1,75 +0,0 @@
1
- --- # information about your project -----------------------------------------
2
-
3
- # Name of your project.
4
- :project: Dfect
5
-
6
- # Name of your project when packaged as a directory.
7
- :package: dfect
8
-
9
- # Name of Ruby module that namespaces your project.
10
- :library: Dfect
11
-
12
- # A short, single-line description of your project.
13
- :tagline: Assertion testing library for Ruby
14
-
15
- # Address of your project's published website.
16
- :website: http://snk.tuxfamily.org/lib/dfect/
17
-
18
- # A list of the core developers of your project.
19
- #
20
- # :authors:
21
- # - An Example <an@example.com> # with email
22
- # - Another Example # without email
23
- #
24
- :authors:
25
- - Suraj N. Kurapati <sunaku@gmail.com>
26
-
27
- # Number of the current release of your project.
28
- :version: 2.0.0
29
-
30
- # Date of the current release of your project.
31
- :release: 2010-03-21
32
-
33
- # A list of gems required by your project during runtime.
34
- #
35
- # :runtime:
36
- # # your project needs exactly version 1.2.3 of the "an_example" gem
37
- # an_example: 1.2.3
38
- #
39
- # # your project needs at least version 1.2 (but not
40
- # # version 1.2.4 or newer) of the "another_example" gem
41
- # another_example: [ >= 1.2 , < 1.2.4 ]
42
- #
43
- # # your project needs any version of the "yet_another_example" gem
44
- # yet_another_example:
45
- #
46
- :runtime:
47
-
48
- # A list of gems required by your project during development.
49
- #
50
- # :devtime:
51
- # # your project needs exactly version 1.2.3 of the "an_example" gem
52
- # an_example: 1.2.3
53
- #
54
- # # your project needs at least version 1.2 (but not
55
- # # version 1.2.4 or newer) of the "another_example" gem
56
- # another_example: [ >= 1.2 , < 1.2.4 ]
57
- #
58
- # # your project needs any version of the "yet_another_example" gem
59
- # yet_another_example:
60
- #
61
- :devtime:
62
-
63
- --- # parameters for the `inochi` command ------------------------------------
64
-
65
- # Location where project documentation will be uploaded by `inochi pub:doc`.
66
- :pub_doc_target: ~/www/lib/dfect/
67
-
68
- # Options for the `rsync` command used to upload your project's documentation.
69
- :pub_doc_options: --verbose --compress --archive --update --delete
70
-
71
- # Path to YAML file containing login information for publishing announcements.
72
- :pub_ann_logins: ~/.config/inochi/pub_ann_logins.yaml
73
-
74
- # Your project's unique identifier in the RAA (Ruby Application Archive).
75
- :pub_ann_raa_id: dfect
@@ -1,17 +0,0 @@
1
- require 'dfect/inochi'
2
-
3
- unless defined? Dfect::INOCHI
4
- fail "Dfect module must be established by Inochi"
5
- end
6
-
7
- Dfect::INOCHI.each do |param, value|
8
- const = param.to_s.upcase
9
-
10
- unless Dfect.const_defined? const
11
- fail "Dfect::#{const} must be established by Inochi"
12
- end
13
-
14
- unless Dfect.const_get(const) == value
15
- fail "Dfect::#{const} is not what Inochi established"
16
- end
17
- end