live_ast_ruby_parser 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
 
2
- = live_ast_ruby_parser ChangeLog
2
+ = live_ast_ruby_parser Changes
3
+
4
+ == Version 0.6.1
5
+
6
+ * removed duplicate version const
3
7
 
4
8
  == Version 0.6.0
5
9
 
data/MANIFEST CHANGED
@@ -1,9 +1,8 @@
1
1
  CHANGES.rdoc
2
2
  MANIFEST
3
- MANIFEST
4
3
  README.rdoc
5
4
  Rakefile
6
- devel/jumpstart.rb
5
+ devel/levitate.rb
7
6
  lib/live_ast_ruby_parser.rb
8
7
  lib/live_ast_ruby_parser/test.rb
9
8
  lib/live_ast_ruby_parser/unparser.rb
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require_relative 'devel/jumpstart'
1
+ require_relative 'devel/levitate'
2
2
 
3
- Jumpstart.new "live_ast_ruby_parser" do |s|
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 Jumpstart
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(project_name)
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
- @project_name = project_name
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
- attribute :name do
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(name)
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/#{name}/version.rb")
284
+ if File.file?(version_file = "./lib/#{gem_name}/version.rb")
287
285
  require version_file
288
- elsif File.file?("./lib/#{name}.rb")
289
- require name
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/#{name}-#{version}.#{ext}"
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
- "#{name}: #{summary}"
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 { |param|
434
- value = send(param) and (
435
- g.send("#{param}=", value)
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/#{name}"
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", "#{name}-" + version.to_s
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 => __jumpstart_exception
820
- puts "raises \#{__jumpstart_exception.class}"
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
- jump = self
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
- jump.run_doc_section(file, section, self, &block)
899
+ levitate.run_doc_section(file, section, self, &block)
870
900
  else
871
- jump.run_doc_section(file, section, self) {
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
- jump = self
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
- jump.run_doc_section(file, section, self, &block)
918
+ levitate.run_doc_section(file, section, self, &block)
889
919
  else
890
- jump.run_doc_section(file, section, self) {
920
+ levitate.run_doc_section(file, section, self) {
891
921
  |expected, actual, index|
892
922
  assert_equal expected, actual
893
923
  }
@@ -1,3 +1,3 @@
1
1
  class LiveASTRubyParser
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -2,8 +2,6 @@ require 'ruby_parser'
2
2
  require 'live_ast/base'
3
3
 
4
4
  class LiveASTRubyParser
5
- VERSION = "0.6.0"
6
-
7
5
  #
8
6
  # Returns a line-to-sexp hash where sexp corresponds to the method
9
7
  # or block defined at the given line.
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.0
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-26 00:00:00 -05:00
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/jumpstart.rb
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.2
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.