live_ast_ripper 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_ripper ChangeLog
2
+ = live_ast_ripper Changes
3
+
4
+ == Version 0.6.1
5
+
6
+ * fix class/module in version.rb
3
7
 
4
8
  == Version 0.6.0
5
9
 
data/devel/levitate.rb CHANGED
@@ -249,12 +249,12 @@ class Levitate
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 Levitate
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 Levitate
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 Levitate
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 Levitate
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 Levitate
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 Levitate
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 Levitate
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 Levitate
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
@@ -1,3 +1,3 @@
1
- module LiveASTRipper
2
- VERSION = "0.6.0"
1
+ class LiveASTRipper
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: live_ast_ripper
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
 
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements: []
60
60
 
61
61
  rubyforge_project:
62
- rubygems_version: 1.5.2
62
+ rubygems_version: 1.5.3
63
63
  signing_key:
64
64
  specification_version: 3
65
65
  summary: A Ripper-based parser plugin for LiveAST.