autoreload 1.1.0 → 1.2.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: 5d195b06220f6ebf62098971a806660fedf14608
4
- data.tar.gz: 23585273514dc91e35cd8755f6e0ce65bdb5bbdd
3
+ metadata.gz: 25dbd16a1c6902601c7a9faa515f4a22629df674
4
+ data.tar.gz: db877dea42c263c0483f2366ae5fbb3169804393
5
5
  SHA512:
6
- metadata.gz: 4e9f3c074a1f8d160d05a24e497bd015432ba1ae9d85c8c02d04c1f5c6ebbcd4fa906f96e2dc07c79e11b4707863432d54b845f7c029bdaed02d9069932c84bc
7
- data.tar.gz: 4b49181378e9e939019d6295cfd20696c78609dc953911b1e6fadc35aaff8de4eb33552fae7b081b947d5f23bf9447cec24bebdf1329f4d329d1885f049af23d
6
+ metadata.gz: 4580e1c18ce5cb1d2d9bde376149a7b4b6f593e29809fe624d0022124d947488e6e12aa3d26b8c320de1673f7ba7fa0840538be5996890e6e2339b3d7c29b254
7
+ data.tar.gz: 7e7eeae32193686048662031d44013954aa10fb36d54d833ecfcaccc03995f98978808caea314bb57235eb8262b5bcde1f5660c4775733ae6d2b5a7af68ad197
data/.index CHANGED
@@ -2,7 +2,7 @@
2
2
  revision: 2013
3
3
  type: ruby
4
4
  sources:
5
- - Indexfile
5
+ - Index.rb
6
6
  - Gemfile
7
7
  authors:
8
8
  - name: Thomas Sawyer
@@ -18,6 +18,21 @@ requirements:
18
18
  - test
19
19
  version: '>= 0'
20
20
  name: minitest
21
+ - engines:
22
+ - name: rbx
23
+ version: 0+
24
+ version: '>= 0'
25
+ name: psych
26
+ - engines:
27
+ - name: rbx
28
+ version: 0+
29
+ version: ~> 2.0
30
+ name: rubysl
31
+ - engines:
32
+ - name: rbx
33
+ version: 0+
34
+ version: '>= 0'
35
+ name: minitest
21
36
  conflicts: []
22
37
  alternatives: []
23
38
  resources:
@@ -42,7 +57,7 @@ customs: []
42
57
  paths:
43
58
  lib:
44
59
  - lib
45
- version: 1.1.0
60
+ version: 1.2.0
46
61
  name: autoreload
47
62
  title: AutoReload
48
63
  summary: Automatically reload library files
@@ -50,4 +65,4 @@ description: Autoreload automatically reloads library files when they have been
50
65
  It is especially useful when testing stateless services such as web applications.
51
66
  created: '2007-07-01'
52
67
  webcvs: https://github.com/rubyworks/autoreload/tree/master
53
- date: '2014-11-08'
68
+ date: '2015-05-07'
data/HISTORY.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 1.2.0
4
+
5
+ Add `watch_gems` option to watch all required gems. The default
6
+ is now to only watch `.rb` files in the current working directory.
7
+
8
+ Changes:
9
+
10
+ * Add `:watch_gems` option.
11
+ * Watch current working directory only, as default.
12
+
13
+
3
14
  ## 1.1.0
4
15
 
5
16
  This release is simply a maintenance release to bring the build
@@ -23,16 +23,26 @@ module AutoReload
23
23
  # :reprime - Include $0 in reload list.
24
24
  #
25
25
  def initialize(options={}, &block)
26
- @interval = (options[:interval] || DEFAULT_INTERVAL).to_i
27
- @verbose = (options[:verbose])
28
- @reprime = (options[:reprime])
26
+ @interval = (options[:interval] || DEFAULT_INTERVAL).to_i
27
+ @verbose = (options[:verbose])
28
+ @reprime = (options[:reprime])
29
+ @watch_gems = (options[:watch_gems])
29
30
 
30
31
  @status = {}
31
32
 
32
33
  features = $".dup
33
34
  if block
34
35
  block.call
35
- @files = ($" - features).reverse
36
+ @files = ($" - features).select do |f|
37
+ (@watch_gems ? true : f.start_with?(Dir.pwd)) && f.end_with?(".rb")
38
+ end.reverse
39
+
40
+ if @verbose
41
+ puts "watching files:"
42
+ puts "---------------"
43
+ puts @files
44
+ puts "---------------"
45
+ end
36
46
  else
37
47
  @files = []
38
48
  end
@@ -120,7 +130,7 @@ module AutoReload
120
130
  rescue LoadError
121
131
  # file has been removed
122
132
  end
123
- else
133
+ else
124
134
  file, mtime = @status[lib]
125
135
  if file
126
136
  if FileTest.exist?(file)
@@ -148,9 +158,9 @@ module AutoReload
148
158
  if FileTest.exist?(file)
149
159
  [file, File.mtime(file).to_i]
150
160
  else
151
- warn "reload fail: library '#{lib}' not found" if verbose?
152
- #raise "The library '#{lib}' is not found."
153
- #$stdout.puts(message("The library '#{lib}' is not found.")) if @verbose
161
+ warn "reload fail: library '#{file}' not found" if verbose?
162
+ #raise "The library '#{file}' is not found."
163
+ #$stdout.puts(message("The library '#{file}' is not found.")) if @verbose
154
164
  [nil, nil]
155
165
  end
156
166
  end
@@ -1,4 +1,4 @@
1
1
  module AutoReload
2
2
  # Public: Current release version.
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoreload
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Sawyer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-08 00:00:00.000000000 Z
12
+ date: 2015-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -39,6 +39,48 @@ dependencies:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: psych
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rubysl
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '2.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '2.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: minitest
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
42
84
  description: Autoreload automatically reloads library files when they have been updated.
43
85
  It is especially useful when testing stateless services such as web applications.
44
86
  email: