lazyportal 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile ADDED
File without changes
data/bin/lazy CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  # Add lib to load path
4
4
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
@@ -6,4 +6,4 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
6
6
  # Load lazyportal
7
7
  require 'lazyportal'
8
8
 
9
- Lazyportal::CLI.generate_tasks
9
+ Lazyportal::CLI.generate_rakefile
data/lazyportal.gemspec CHANGED
@@ -11,4 +11,6 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.executables = [ 'lazy' ]
13
13
  s.files = FileList[ '[A-Z]*', 'lib/**/*', 'lazyportal.gemspec' ]
14
+
15
+ s.add_dependency('sass', '3.1.0.alpha.256')
14
16
  end
@@ -1,6 +1,9 @@
1
1
  module Lazyportal::CLI
2
2
 
3
- def generate_tasks
3
+ def generate_rakefile
4
+
5
+ # Rakefile contents includes the Tasks
6
+ # module and loads lazy's tasks
4
7
  tasks = %{
5
8
  require 'rubygems'
6
9
  require 'lazyportal'
@@ -9,10 +12,32 @@ include Lazyportal::Tasks
9
12
 
10
13
  Lazyportal::Tasks.load_tasks
11
14
  }
15
+
16
+ # Use existing Rakefile if one exists
17
+ rakefile = existing_rakefile.nil? ? "Rakefile" : existing_rakefile
18
+
19
+ # Append contents to existing Rakefile
20
+ # or generate a new Rakefile
21
+ create_file rakefile, tasks, :noclobber => true
22
+
23
+ # Print message to tell the user
24
+ # what happened
25
+ print_message
26
+ end
27
+
28
+ private
12
29
 
13
- File.open("Rakefile", "w+") do |f|
14
- f.write(tasks)
30
+ def print_message
31
+ if existing_rakefile.nil?
32
+ puts "lazy generated a new Rakefile"
33
+ puts "type rake -T to see available tasks"
34
+ else
35
+ puts "lazy tasks were appended to existing Rakefile"
15
36
  end
16
37
  end
38
+
39
+ def existing_rakefile
40
+ Dir["*"].select { |f| f.match /rakefile/i }[0]
41
+ end
17
42
 
18
43
  end
@@ -0,0 +1,13 @@
1
+ module Lazyportal::Helpers
2
+
3
+ def create_file file, contents, modes={}
4
+ mode = case modes
5
+ when :noclobber then "a+"
6
+ when :read_only then "r"
7
+ else "w+"
8
+ end
9
+
10
+ File.open(file, mode) { |f| f.write(contents) }
11
+ end
12
+
13
+ end
@@ -1,7 +1,7 @@
1
1
  module Lazyportal::Tasks
2
2
 
3
3
  def load_tasks
4
- Dir[File.dirname(__FILE__) + '/tasks.rake'].each { |f| load f }
4
+ Dir[File.dirname(__FILE__) + "/tasks/**/*.rake"].each { |f| load f }
5
5
  end
6
6
 
7
7
  end
data/lib/lazyportal.rb CHANGED
@@ -1,21 +1,19 @@
1
1
  module Lazyportal
2
2
 
3
- # current version of lazyportal
4
- VERSION = '0.0.4'
3
+ VERSION = '0.0.6'
5
4
 
6
5
  end
7
6
 
8
- # libraries
7
+ # Load dependencies
9
8
  require 'rake'
10
9
 
11
- # gems
12
- require 'rubygems'
13
-
14
- # lazyportal
10
+ # Load lazyportal
15
11
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
16
12
 
13
+ require 'lazyportal/helpers'
17
14
  require 'lazyportal/tasks'
18
15
  require 'lazyportal/cli'
19
16
 
17
+ include Lazyportal::Helpers
20
18
  include Lazyportal::Tasks
21
19
  include Lazyportal::CLI
@@ -1,10 +1,12 @@
1
1
  task :lazy do
2
+ puts ""
2
3
  puts ' _ ____ ____ _ _ _____ ____ ____ '
3
4
  puts ' / \ / _ \/_ \/ \/ \ /|/ __// ___\/ ___\ '
4
5
  puts ' | | | / \| / /| || |\ ||| \ | \| \ '
5
6
  puts ' | |_/\| |-||/ /_| || | \||| /_ \___ |\___ | '
6
7
  puts ' \____/\_/ \|\____/\_/\_/ \|\____/\____/\____/ '
7
- puts ''
8
+ puts ""
8
9
  puts ' "The quality that makes you go to great effort '
9
10
  puts ' to reduce overall energy expenditure."'
11
+ puts ""
10
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazyportal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-04-22 00:00:00.000000000Z
13
- dependencies: []
12
+ date: 2011-04-23 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: &2156021560 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.0.alpha.256
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2156021560
14
25
  description:
15
26
  email: jacob.d.lichner@gmail.com
16
27
  executables:
@@ -18,15 +29,15 @@ executables:
18
29
  extensions: []
19
30
  extra_rdoc_files: []
20
31
  files:
21
- - Gemfile
22
- - Gemfile.lock
23
32
  - LICENSE.txt
33
+ - Rakefile
24
34
  - README.md
25
35
  - TODO.txt
26
36
  - lib/lazyportal/cli.rb
27
- - lib/lazyportal/tasks.rake
37
+ - lib/lazyportal/helpers.rb
28
38
  - lib/lazyportal/tasks.rb
29
39
  - lib/lazyportal.rb
40
+ - lib/tasks/lazy.rake
30
41
  - lazyportal.gemspec
31
42
  - bin/lazy
32
43
  homepage:
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "nokogiri"
4
- gem "sass", "3.1.0.alpha.256"
data/Gemfile.lock DELETED
@@ -1,12 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- nokogiri (1.4.4)
5
- sass (3.1.0.alpha.256)
6
-
7
- PLATFORMS
8
- ruby
9
-
10
- DEPENDENCIES
11
- nokogiri
12
- sass (= 3.1.0.alpha.256)