lre 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.document +5 -5
- data/.rspec +1 -1
- data/Gemfile +14 -14
- data/Gemfile.lock +59 -22
- data/LICENSE.txt +20 -20
- data/README.md +67 -67
- data/Rakefile +50 -60
- data/VERSION +1 -1
- data/bin/lre +4 -4
- data/lib/lre.rb +59 -59
- data/lib/lre/file_reload.rb +83 -83
- data/lib/lre/rake_ext.rb +21 -21
- data/lib/lre/watchr_ext.rb +14 -0
- data/lre.gemspec +85 -91
- data/spec/lre_spec.rb +8 -8
- data/spec/spec_helper.rb +12 -12
- data/spec/test_dir/bar.rb +2 -2
- data/spec/test_dir/foo.rb +2 -2
- metadata +70 -54
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MjBlZDI4MmM0MjNmMDVmNTk2ZDIxNTVhZmZkZDc2OTRjMWRhMmZkOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OWIyMmJlM2M1NmY3NzJiY2Q4Y2I5MmQ4NjcyN2ExMTEyOTQ3N2E1Mw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ODEyZGQ0YjhlOWNjMzMzOTVkNzIzMjU4MWIxM2I0OWU5MzIwZGM2OWZhMjVj
|
10
|
+
OGY5ODRkZjgzMDUwNzk4MDNjMzA0YjY2OTUyOWFjZWI4YTUyZGZlYTlhNmM3
|
11
|
+
ZjE2YTI5OGViOWRjYmFlODkxMDc5MTI5OWY3MWEwOTJjNWJhYmE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTIyMDkwMDYyNDQyYmFlZWE2MjA3MjdiZTlkYzdlOWViOWU4OTIwOWE0OTcx
|
14
|
+
NzFjYzQ2MGJkOWIzMDFkMTIwMDdlMzgwNWU0ZjZhYzQ2ODdhZWU0OWY0Zjdj
|
15
|
+
MzY3Yjk4ODI2MzdkOGJlYTRkYWQwMDgwMWM3NzQwMjZiYjk1MWQ=
|
data/.document
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
lib/**/*.rb
|
2
|
-
bin/*
|
3
|
-
-
|
4
|
-
features/**/*.feature
|
5
|
-
LICENSE.txt
|
1
|
+
lib/**/*.rb
|
2
|
+
bin/*
|
3
|
+
-
|
4
|
+
features/**/*.feature
|
5
|
+
LICENSE.txt
|
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--color
|
1
|
+
--color
|
data/Gemfile
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
|
3
|
-
group :development do
|
4
|
-
gem "rspec", "~> 2.
|
5
|
-
gem "
|
6
|
-
gem "
|
7
|
-
gem "
|
8
|
-
gem 'github-markup'
|
9
|
-
gem 'rdiscount'
|
10
|
-
end
|
11
|
-
|
12
|
-
gem 'fattr'
|
13
|
-
#gem 'rake'
|
14
|
-
gem 'watchr'
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem "rspec", "~> 2.8.0"
|
5
|
+
gem "rdoc", "~> 3.12"
|
6
|
+
gem "bundler", ">= 1.0"
|
7
|
+
gem "jeweler", "~> 1.8.7"
|
8
|
+
gem 'github-markup'
|
9
|
+
gem 'rdiscount'
|
10
|
+
end
|
11
|
+
|
12
|
+
gem 'fattr'
|
13
|
+
#gem 'rake'
|
14
|
+
gem 'watchr'
|
15
15
|
gem 'mharris_ext'
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,78 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
addressable (2.3.6)
|
5
|
+
builder (3.2.2)
|
6
|
+
diff-lcs (1.1.3)
|
7
|
+
facets (2.9.3)
|
8
|
+
faraday (0.8.9)
|
9
|
+
multipart-post (~> 1.2.0)
|
10
|
+
fattr (2.2.2)
|
11
|
+
git (1.2.6)
|
12
|
+
github-markup (1.2.1)
|
13
|
+
posix-spawn (~> 0.3.8)
|
14
|
+
github_api (0.10.1)
|
15
|
+
addressable
|
16
|
+
faraday (~> 0.8.1)
|
17
|
+
hashie (>= 1.2)
|
18
|
+
multi_json (~> 1.4)
|
19
|
+
nokogiri (~> 1.5.2)
|
20
|
+
oauth2
|
21
|
+
hashie (2.1.1)
|
22
|
+
highline (1.6.21)
|
23
|
+
jeweler (1.8.8)
|
24
|
+
builder
|
25
|
+
bundler (~> 1.0)
|
11
26
|
git (>= 1.2.5)
|
27
|
+
github_api (= 0.10.1)
|
28
|
+
highline (>= 1.6.15)
|
29
|
+
nokogiri (= 1.5.10)
|
12
30
|
rake
|
13
|
-
|
31
|
+
rdoc
|
32
|
+
json (1.8.1)
|
33
|
+
jwt (0.1.11)
|
34
|
+
multi_json (>= 1.5)
|
35
|
+
mharris_ext (1.7.1)
|
14
36
|
facets
|
15
37
|
fattr
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
38
|
+
multi_json (1.9.3)
|
39
|
+
multi_xml (0.5.5)
|
40
|
+
multipart-post (1.2.0)
|
41
|
+
nokogiri (1.5.10)
|
42
|
+
nokogiri (1.5.10-x86-mingw32)
|
43
|
+
oauth2 (0.9.3)
|
44
|
+
faraday (>= 0.8, < 0.10)
|
45
|
+
jwt (~> 0.1.8)
|
46
|
+
multi_json (~> 1.3)
|
47
|
+
multi_xml (~> 0.5)
|
48
|
+
rack (~> 1.2)
|
49
|
+
posix-spawn (0.3.8)
|
50
|
+
rack (1.5.2)
|
51
|
+
rake (10.3.1)
|
52
|
+
rdiscount (2.1.7.1)
|
53
|
+
rdoc (3.12.2)
|
54
|
+
json (~> 1.4)
|
55
|
+
rspec (2.8.0)
|
56
|
+
rspec-core (~> 2.8.0)
|
57
|
+
rspec-expectations (~> 2.8.0)
|
58
|
+
rspec-mocks (~> 2.8.0)
|
59
|
+
rspec-core (2.8.0)
|
60
|
+
rspec-expectations (2.8.0)
|
25
61
|
diff-lcs (~> 1.1.2)
|
26
|
-
rspec-mocks (2.
|
62
|
+
rspec-mocks (2.8.0)
|
27
63
|
watchr (0.7)
|
28
64
|
|
29
65
|
PLATFORMS
|
66
|
+
ruby
|
30
67
|
x86-mingw32
|
31
68
|
|
32
69
|
DEPENDENCIES
|
33
|
-
bundler (
|
70
|
+
bundler (>= 1.0)
|
34
71
|
fattr
|
35
72
|
github-markup
|
36
|
-
jeweler (~> 1.
|
73
|
+
jeweler (~> 1.8.7)
|
37
74
|
mharris_ext
|
38
|
-
rcov
|
39
75
|
rdiscount
|
40
|
-
|
76
|
+
rdoc (~> 3.12)
|
77
|
+
rspec (~> 2.8.0)
|
41
78
|
watchr
|
data/LICENSE.txt
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright (c) 2011 mharris717
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2011 mharris717
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,67 +1,67 @@
|
|
1
|
-
# LRE
|
2
|
-
|
3
|
-
When debugging or poking around in a project, I often do several things
|
4
|
-
|
5
|
-
* Start an IRB session.
|
6
|
-
* Load some files at the beginning to setup my environment.
|
7
|
-
* When the code I'm writing gets too long to comfortably write at the IRB prompt, move the code to a file and repeatedly load the file after making changes.
|
8
|
-
* Make changes to existing files and load those changes.
|
9
|
-
* Make changes to libraries and load those changes.
|
10
|
-
|
11
|
-
LRE makes these things easy.
|
12
|
-
|
13
|
-
## Basics
|
14
|
-
|
15
|
-
Start LRE with the lre command at the command prompt.
|
16
|
-
|
17
|
-
On startup, LRE
|
18
|
-
|
19
|
-
* Looks for .lre files in the root of the current directory and the home directory, and loads them if present. These files are plain ruby files. Put environment setup code and helper functions here.
|
20
|
-
* Monitors the current directory for changes to .rb files, and automatically loads changed files.
|
21
|
-
* Starts an IRB prompt.
|
22
|
-
|
23
|
-
## Additional Features
|
24
|
-
|
25
|
-
You can monitor additional directories and file types.
|
26
|
-
|
27
|
-
To monitor additional directories, add them in your .lre file. This will watch for .rb files.
|
28
|
-
|
29
|
-
|
30
|
-
LRE.add_watch_dir "/code/something", "/code/something_else"
|
31
|
-
|
32
|
-
To monitor addtional file types, add a watch in your .lre file
|
33
|
-
|
34
|
-
LRE.watch(".*/run_on_change/.*\.sql") do |f|
|
35
|
-
require 'sws'
|
36
|
-
str = parse_erb_str(File.read(f))
|
37
|
-
SWS.execute_str! str
|
38
|
-
end
|
39
|
-
|
40
|
-
LRE won't automatically pick up on new files, only changed files. Calling LRE.start! will cause new files to be monitored going forward.
|
41
|
-
|
42
|
-
LRE.start!
|
43
|
-
|
44
|
-
|
45
|
-
## Installing
|
46
|
-
|
47
|
-
gem install lre
|
48
|
-
|
49
|
-
## Other
|
50
|
-
|
51
|
-
LRE is short for Little Ruby Environment or nothing, depending on my mood.
|
52
|
-
|
53
|
-
## Contributing to lre
|
54
|
-
|
55
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
56
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
57
|
-
* Fork the project
|
58
|
-
* Start a feature/bugfix branch
|
59
|
-
* Commit and push until you are happy with your contribution
|
60
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
61
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
62
|
-
|
63
|
-
## Copyright
|
64
|
-
|
65
|
-
Copyright (c) 2011 mharris717. See LICENSE.txt for
|
66
|
-
further details.
|
67
|
-
|
1
|
+
# LRE
|
2
|
+
|
3
|
+
When debugging or poking around in a project, I often do several things
|
4
|
+
|
5
|
+
* Start an IRB session.
|
6
|
+
* Load some files at the beginning to setup my environment.
|
7
|
+
* When the code I'm writing gets too long to comfortably write at the IRB prompt, move the code to a file and repeatedly load the file after making changes.
|
8
|
+
* Make changes to existing files and load those changes.
|
9
|
+
* Make changes to libraries and load those changes.
|
10
|
+
|
11
|
+
LRE makes these things easy.
|
12
|
+
|
13
|
+
## Basics
|
14
|
+
|
15
|
+
Start LRE with the lre command at the command prompt.
|
16
|
+
|
17
|
+
On startup, LRE
|
18
|
+
|
19
|
+
* Looks for .lre files in the root of the current directory and the home directory, and loads them if present. These files are plain ruby files. Put environment setup code and helper functions here.
|
20
|
+
* Monitors the current directory for changes to .rb files, and automatically loads changed files.
|
21
|
+
* Starts an IRB prompt.
|
22
|
+
|
23
|
+
## Additional Features
|
24
|
+
|
25
|
+
You can monitor additional directories and file types.
|
26
|
+
|
27
|
+
To monitor additional directories, add them in your .lre file. This will watch for .rb files.
|
28
|
+
|
29
|
+
|
30
|
+
LRE.add_watch_dir "/code/something", "/code/something_else"
|
31
|
+
|
32
|
+
To monitor addtional file types, add a watch in your .lre file
|
33
|
+
|
34
|
+
LRE.watch(".*/run_on_change/.*\.sql") do |f|
|
35
|
+
require 'sws'
|
36
|
+
str = parse_erb_str(File.read(f))
|
37
|
+
SWS.execute_str! str
|
38
|
+
end
|
39
|
+
|
40
|
+
LRE won't automatically pick up on new files, only changed files. Calling LRE.start! will cause new files to be monitored going forward.
|
41
|
+
|
42
|
+
LRE.start!
|
43
|
+
|
44
|
+
|
45
|
+
## Installing
|
46
|
+
|
47
|
+
gem install lre
|
48
|
+
|
49
|
+
## Other
|
50
|
+
|
51
|
+
LRE is short for Little Ruby Environment or nothing, depending on my mood.
|
52
|
+
|
53
|
+
## Contributing to lre
|
54
|
+
|
55
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
56
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
57
|
+
* Fork the project
|
58
|
+
* Start a feature/bugfix branch
|
59
|
+
* Commit and push until you are happy with your contribution
|
60
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
61
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
62
|
+
|
63
|
+
## Copyright
|
64
|
+
|
65
|
+
Copyright (c) 2011 mharris717. See LICENSE.txt for
|
66
|
+
further details.
|
67
|
+
|
data/Rakefile
CHANGED
@@ -1,61 +1,51 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'rake'
|
11
|
-
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "lre"
|
16
|
-
gem.homepage = "http://github.com/mharris717/lre"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = %Q{lre}
|
19
|
-
gem.description = %Q{lre}
|
20
|
-
gem.email = "mharris717@gmail.com"
|
21
|
-
gem.authors = ["mharris717"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
|
-
require 'rspec/core'
|
30
|
-
require 'rspec/core/rake_task'
|
31
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
-
end
|
34
|
-
|
35
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
36
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
-
spec.rcov = true
|
38
|
-
end
|
39
|
-
|
40
|
-
task :default => :spec
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
task :make_readme do
|
53
|
-
require 'github/markup'
|
54
|
-
require 'mharris_ext'
|
55
|
-
|
56
|
-
loop do
|
57
|
-
str = GitHub::Markup.render("README.md")
|
58
|
-
File.create("README.html",str)
|
59
|
-
sleep(0.5)
|
60
|
-
end
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "lre"
|
16
|
+
gem.homepage = "http://github.com/mharris717/lre"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{lre}
|
19
|
+
gem.description = %Q{lre}
|
20
|
+
gem.email = "mharris717@gmail.com"
|
21
|
+
gem.authors = ["mharris717"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
+
end
|
34
|
+
|
35
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.rcov = true
|
38
|
+
end
|
39
|
+
|
40
|
+
task :default => :spec
|
41
|
+
|
42
|
+
task :make_readme do
|
43
|
+
require 'github/markup'
|
44
|
+
require 'mharris_ext'
|
45
|
+
|
46
|
+
loop do
|
47
|
+
str = GitHub::Markup.render("README.md")
|
48
|
+
File.create("README.html",str)
|
49
|
+
sleep(0.5)
|
50
|
+
end
|
61
51
|
end
|