lazyportal 0.0.6 → 0.0.8
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/lazyportal.gemspec +0 -2
- data/lib/lazyportal/cli.rb +33 -30
- data/lib/lazyportal/helpers.rb +11 -9
- data/lib/{tasks → lazyportal/tasks}/lazy.rake +0 -0
- data/lib/lazyportal/tasks.rb +6 -4
- data/lib/lazyportal.rb +1 -1
- metadata +3 -14
data/lazyportal.gemspec
CHANGED
data/lib/lazyportal/cli.rb
CHANGED
@@ -1,43 +1,46 @@
|
|
1
|
-
module Lazyportal
|
1
|
+
module Lazyportal
|
2
|
+
module CLI
|
2
3
|
|
3
|
-
|
4
|
+
def generate_rakefile
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
require 'rubygems'
|
9
|
-
require 'lazyportal'
|
6
|
+
# Rakefile contents includes the Tasks
|
7
|
+
# module and loads lazy's tasks
|
8
|
+
tasks = %{
|
9
|
+
require 'rubygems'
|
10
|
+
require 'lazyportal'
|
10
11
|
|
11
|
-
include Lazyportal::Tasks
|
12
|
+
include Lazyportal::Tasks
|
12
13
|
|
13
|
-
Lazyportal::Tasks.load_tasks
|
14
|
-
|
14
|
+
Lazyportal::Tasks.load_tasks
|
15
|
+
}
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
# Use existing Rakefile if one exists
|
18
|
+
rakefile = existing_rakefile.nil? ? "Rakefile" : existing_rakefile
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
# Append contents to existing Rakefile
|
21
|
+
# or generate a new Rakefile
|
22
|
+
create_file rakefile, tasks, :noclobber => true
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
# Print message to tell the user
|
25
|
+
# what happened
|
26
|
+
print_message
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
+
private
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
def print_message
|
32
|
+
if existing_rakefile.nil?
|
33
|
+
puts "lazy generated a new Rakefile"
|
34
|
+
puts "type rake -T to see available tasks"
|
35
|
+
else
|
36
|
+
puts "lazy tasks were appended to existing Rakefile"
|
37
|
+
end
|
36
38
|
end
|
37
|
-
end
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
def existing_rakefile
|
41
|
+
pwd = `echo $PWD`.chomp
|
42
|
+
Dir[pwd + "/*"].select { |f| f.match /rakefile/i }[0]
|
43
|
+
end
|
42
44
|
|
45
|
+
end
|
43
46
|
end
|
data/lib/lazyportal/helpers.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
module Lazyportal
|
1
|
+
module Lazyportal
|
2
|
+
module Helpers
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def create_file file, contents, modes={}
|
5
|
+
mode = case modes
|
6
|
+
when :noclobber then "a+"
|
7
|
+
when :read_only then "r"
|
8
|
+
else "w+"
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
File.open(file, mode) { |f| f.write(contents) }
|
12
|
+
end
|
12
13
|
|
14
|
+
end
|
13
15
|
end
|
File without changes
|
data/lib/lazyportal/tasks.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
module Lazyportal
|
1
|
+
module Lazyportal
|
2
|
+
module Tasks
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def load_tasks
|
5
|
+
Dir[File.dirname(__FILE__) + "/tasks/**/*.rake"].each { |f| load f }
|
6
|
+
end
|
7
|
+
|
5
8
|
end
|
6
|
-
|
7
9
|
end
|
data/lib/lazyportal.rb
CHANGED
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
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,18 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
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
|
13
|
+
dependencies: []
|
25
14
|
description:
|
26
15
|
email: jacob.d.lichner@gmail.com
|
27
16
|
executables:
|
@@ -35,9 +24,9 @@ files:
|
|
35
24
|
- TODO.txt
|
36
25
|
- lib/lazyportal/cli.rb
|
37
26
|
- lib/lazyportal/helpers.rb
|
27
|
+
- lib/lazyportal/tasks/lazy.rake
|
38
28
|
- lib/lazyportal/tasks.rb
|
39
29
|
- lib/lazyportal.rb
|
40
|
-
- lib/tasks/lazy.rake
|
41
30
|
- lazyportal.gemspec
|
42
31
|
- bin/lazy
|
43
32
|
homepage:
|