live_ast_ruby_parser 0.6.0 → 0.6.1
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.
- data/CHANGES.rdoc +5 -1
- data/MANIFEST +1 -2
- data/Rakefile +2 -2
- data/devel/{jumpstart.rb → levitate.rb} +62 -32
- data/lib/live_ast_ruby_parser/version.rb +1 -1
- data/lib/live_ast_ruby_parser.rb +0 -2
- metadata +5 -5
data/CHANGES.rdoc
CHANGED
data/MANIFEST
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative 'devel/
|
1
|
+
require_relative 'devel/levitate'
|
2
2
|
|
3
|
-
|
3
|
+
Levitate.new "live_ast_ruby_parser" do |s|
|
4
4
|
s.camel_name = "LiveASTRubyParser"
|
5
5
|
s.developers << ["James M. Lawrence", "quixoticsycophant@gmail.com"]
|
6
6
|
s.github_user = "quix"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
class
|
2
|
+
class Levitate
|
3
3
|
class Installer
|
4
4
|
def initialize
|
5
5
|
require 'fileutils'
|
@@ -249,12 +249,12 @@ class Jumpstart
|
|
249
249
|
include AttrLazy
|
250
250
|
include Util
|
251
251
|
|
252
|
-
def initialize(
|
252
|
+
def initialize(gem_name)
|
253
253
|
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
254
254
|
|
255
255
|
require 'rubygems/package_task'
|
256
256
|
|
257
|
-
@
|
257
|
+
@gem_name = gem_name
|
258
258
|
|
259
259
|
yield self
|
260
260
|
|
@@ -269,24 +269,22 @@ class Jumpstart
|
|
269
269
|
alias_method :attribute, :attr_lazy_accessor
|
270
270
|
end
|
271
271
|
|
272
|
-
|
273
|
-
@project_name
|
274
|
-
end
|
272
|
+
attr_reader :gem_name
|
275
273
|
|
276
274
|
attribute :version_constant_name do
|
277
275
|
"VERSION"
|
278
276
|
end
|
279
277
|
|
280
278
|
attribute :camel_name do
|
281
|
-
to_camel_case(
|
279
|
+
to_camel_case(gem_name)
|
282
280
|
end
|
283
281
|
|
284
282
|
attribute :version do
|
285
283
|
catch :bail do
|
286
|
-
if File.file?(version_file = "./lib/#{
|
284
|
+
if File.file?(version_file = "./lib/#{gem_name}/version.rb")
|
287
285
|
require version_file
|
288
|
-
elsif File.file?("./lib/#{
|
289
|
-
require
|
286
|
+
elsif File.file?("./lib/#{gem_name}.rb")
|
287
|
+
require gem_name
|
290
288
|
else
|
291
289
|
throw :bail
|
292
290
|
end
|
@@ -337,7 +335,7 @@ class Jumpstart
|
|
337
335
|
|
338
336
|
[:gem, :tgz].each { |ext|
|
339
337
|
attribute ext do
|
340
|
-
"pkg/#{
|
338
|
+
"pkg/#{gem_name}-#{version}.#{ext}"
|
341
339
|
end
|
342
340
|
}
|
343
341
|
|
@@ -383,7 +381,7 @@ class Jumpstart
|
|
383
381
|
end
|
384
382
|
|
385
383
|
attribute :rdoc_title do
|
386
|
-
"#{
|
384
|
+
"#{gem_name}: #{summary}"
|
387
385
|
end
|
388
386
|
|
389
387
|
attribute :require_paths do
|
@@ -418,9 +416,7 @@ class Jumpstart
|
|
418
416
|
|
419
417
|
attribute :gemspec do
|
420
418
|
Gem::Specification.new do |g|
|
421
|
-
g.has_rdoc = true
|
422
419
|
%w[
|
423
|
-
name
|
424
420
|
authors
|
425
421
|
email
|
426
422
|
summary
|
@@ -430,18 +426,15 @@ class Jumpstart
|
|
430
426
|
rdoc_options
|
431
427
|
extra_rdoc_files
|
432
428
|
require_paths
|
433
|
-
].each
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
429
|
+
].each do |param|
|
430
|
+
t = send(param) and g.send("#{param}=", t)
|
431
|
+
end
|
432
|
+
g.name = gem_name
|
433
|
+
g.has_rdoc = true
|
439
434
|
g.homepage = url if url
|
440
|
-
|
441
435
|
dependencies.each { |dep|
|
442
436
|
g.add_dependency(*dep)
|
443
437
|
}
|
444
|
-
|
445
438
|
development_dependencies.each { |dep|
|
446
439
|
g.add_development_dependency(*dep)
|
447
440
|
}
|
@@ -495,7 +488,7 @@ class Jumpstart
|
|
495
488
|
}
|
496
489
|
|
497
490
|
attribute :url do
|
498
|
-
"http://#{github_user}.github.com/#{
|
491
|
+
"http://#{github_user}.github.com/#{gem_name}"
|
499
492
|
end
|
500
493
|
|
501
494
|
attribute :github_user do
|
@@ -737,6 +730,43 @@ class Jumpstart
|
|
737
730
|
end
|
738
731
|
end
|
739
732
|
|
733
|
+
def define_update_levitate
|
734
|
+
url = ENV["LEVITATE"] ||
|
735
|
+
"https://github.com/quix/levitate/raw/master/levitate.rb"
|
736
|
+
task :update_levitate do
|
737
|
+
if system "curl", "-s", "-o", __FILE__, url
|
738
|
+
if `git diff #{__FILE__}` == ""
|
739
|
+
puts "Already up-to-date."
|
740
|
+
else
|
741
|
+
git "commit", __FILE__, "-m", "updated levitate"
|
742
|
+
puts "Updated levitate."
|
743
|
+
end
|
744
|
+
else
|
745
|
+
raise "levitate download failed"
|
746
|
+
end
|
747
|
+
end
|
748
|
+
end
|
749
|
+
|
750
|
+
def define_changes
|
751
|
+
task :changes do
|
752
|
+
header = "\n\n== Version ____\n\n"
|
753
|
+
|
754
|
+
bullets = `git log --format=%s #{last_release}..HEAD`.lines.map { |line|
|
755
|
+
"* #{line}"
|
756
|
+
}.join.chomp
|
757
|
+
|
758
|
+
write_file(history_file) do
|
759
|
+
File.read(history_file).sub(/(?<=#{gem_name} Changes)/) {
|
760
|
+
header + bullets
|
761
|
+
}
|
762
|
+
end
|
763
|
+
end
|
764
|
+
end
|
765
|
+
|
766
|
+
def last_release
|
767
|
+
`git tag`.lines.select { |t| t.index(gem_name) == 0 }.last.chomp
|
768
|
+
end
|
769
|
+
|
740
770
|
def git(*args)
|
741
771
|
sh "git", *args
|
742
772
|
end
|
@@ -751,7 +781,7 @@ class Jumpstart
|
|
751
781
|
task :prerelease => [:clean, :check_directory, :ping, history_file]
|
752
782
|
|
753
783
|
task :finish_release do
|
754
|
-
git "tag", "#{
|
784
|
+
git "tag", "#{gem_name}-" + version.to_s
|
755
785
|
git "push", "--tags", "origin", "master"
|
756
786
|
sh "gem", "push", gem
|
757
787
|
end
|
@@ -816,8 +846,8 @@ class Jumpstart
|
|
816
846
|
begin
|
817
847
|
}
|
818
848
|
footer = %{
|
819
|
-
rescue Exception =>
|
820
|
-
puts "raises \#{
|
849
|
+
rescue Exception => __levitate_exception
|
850
|
+
puts "raises \#{__levitate_exception.class}"
|
821
851
|
end
|
822
852
|
}
|
823
853
|
final_code = header + code + footer
|
@@ -860,15 +890,15 @@ class Jumpstart
|
|
860
890
|
end
|
861
891
|
|
862
892
|
def doc_to_spec(file, *sections, &block)
|
863
|
-
|
893
|
+
levitate = self
|
864
894
|
describe file do
|
865
895
|
sections.each { |section|
|
866
896
|
describe "section `#{section}'" do
|
867
897
|
it "should run as claimed" do
|
868
898
|
if block
|
869
|
-
|
899
|
+
levitate.run_doc_section(file, section, self, &block)
|
870
900
|
else
|
871
|
-
|
901
|
+
levitate.run_doc_section(file, section, self) {
|
872
902
|
|expected, actual, index|
|
873
903
|
actual.should == expected
|
874
904
|
}
|
@@ -880,14 +910,14 @@ class Jumpstart
|
|
880
910
|
end
|
881
911
|
|
882
912
|
def doc_to_test(file, *sections, &block)
|
883
|
-
|
913
|
+
levitate = self
|
884
914
|
klass = Class.new MiniTest::Unit::TestCase do
|
885
915
|
sections.each { |section|
|
886
916
|
define_method "test_#{file}_#{section}" do
|
887
917
|
if block
|
888
|
-
|
918
|
+
levitate.run_doc_section(file, section, self, &block)
|
889
919
|
else
|
890
|
-
|
920
|
+
levitate.run_doc_section(file, section, self) {
|
891
921
|
|expected, actual, index|
|
892
922
|
assert_equal expected, actual
|
893
923
|
}
|
data/lib/live_ast_ruby_parser.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: live_ast_ruby_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James M. Lawrence
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-27 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -46,14 +46,14 @@ extra_rdoc_files:
|
|
46
46
|
- README.rdoc
|
47
47
|
files:
|
48
48
|
- CHANGES.rdoc
|
49
|
-
- MANIFEST
|
50
49
|
- README.rdoc
|
51
50
|
- Rakefile
|
52
|
-
- devel/
|
51
|
+
- devel/levitate.rb
|
53
52
|
- lib/live_ast_ruby_parser.rb
|
54
53
|
- lib/live_ast_ruby_parser/test.rb
|
55
54
|
- lib/live_ast_ruby_parser/unparser.rb
|
56
55
|
- lib/live_ast_ruby_parser/version.rb
|
56
|
+
- MANIFEST
|
57
57
|
has_rdoc: true
|
58
58
|
homepage: http://quix.github.com/live_ast_ruby_parser
|
59
59
|
licenses: []
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements: []
|
82
82
|
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 1.5.
|
84
|
+
rubygems_version: 1.5.3
|
85
85
|
signing_key:
|
86
86
|
specification_version: 3
|
87
87
|
summary: This is the default RubyParser-based parser used by LiveAST.
|