pamela 0.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/README.md +50 -0
- data/Rakefile +8 -0
- data/lib/pamela.rb +1 -0
- data/lib/pamela/pamela.rb +40 -0
- data/lib/pamela/version.rb +3 -0
- metadata +70 -0
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Pamela
|
2
|
+
|
3
|
+
I find myself writing the same Rake tasks over and over. Pamela takes care of that for me.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install pamela
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
In your Rakefile:
|
12
|
+
|
13
|
+
require 'pamela'
|
14
|
+
|
15
|
+
Pamela.load :spec, :console
|
16
|
+
|
17
|
+
Then in your terminal:
|
18
|
+
|
19
|
+
$ rake spec
|
20
|
+
$ rake console
|
21
|
+
|
22
|
+
There are currently three tasks available: `spec`, `test` and `console`.
|
23
|
+
|
24
|
+
## Tasks
|
25
|
+
|
26
|
+
### spec
|
27
|
+
|
28
|
+
Adds your typical `rake spec` task. Includes all the files ending in `_spec.rb` in your `spec/`
|
29
|
+
directory.
|
30
|
+
|
31
|
+
|
32
|
+
### test
|
33
|
+
|
34
|
+
Adds the `rake test` task. Includes all the files matchin in `*test*.rb` in your `test/`
|
35
|
+
directory.
|
36
|
+
|
37
|
+
### console
|
38
|
+
|
39
|
+
Adds a console to your application that loads the environment in `lib/`. This is useful for
|
40
|
+
debugging your applications without having to manually require the files everytime. Expects the
|
41
|
+
file name of the main file (`lib/something.rb`) to match the project directory name (`something/`).
|
42
|
+
|
43
|
+
## Ch-ch-ch-changes
|
44
|
+
|
45
|
+
This is a work in progress. Fork away and send pull requests. Report any problems in the [issue
|
46
|
+
tracker](http://github.com/febuiles/pamela/issues).
|
47
|
+
|
48
|
+
Federico Builes - [federico.builes@gmail.com](federico.builes@gmail.com)
|
49
|
+
|
50
|
+
|
data/Rakefile
ADDED
data/lib/pamela.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'pamela/pamela'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Pamela
|
2
|
+
def self.load(*args)
|
3
|
+
args.flatten.each { |arg| self.send(arg) }
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.spec
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
|
9
|
+
file_list = FileList['spec/**/*_spec.rb']
|
10
|
+
RSpec::Core::RakeTask.new('spec') do |t|
|
11
|
+
t.pattern = file_list
|
12
|
+
t.rspec_opts = ["--colour", "--format progress"]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.test
|
17
|
+
require 'rake/testtask'
|
18
|
+
file_list = FileList['test/**/*test*.rb']
|
19
|
+
Rake::TestTask.new do |t|
|
20
|
+
t.libs << "test"
|
21
|
+
t.test_files = file_list
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.console
|
26
|
+
task :console do
|
27
|
+
start_irb(self.app_name)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.app_name
|
32
|
+
rakefile_dir = Rake.application.find_rakefile_location.last
|
33
|
+
name = rakefile_dir.split("/").last
|
34
|
+
name or raise Exception, "Project name not found"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.start_irb(app_name)
|
38
|
+
exec("irb -Ilib -r#{self.app_name}")
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pamela
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: "0.1"
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Federico Builes
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-02-02 00:00:00 -05:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: mocha
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :development
|
26
|
+
version_requirements: *id001
|
27
|
+
description: See the README or https://github.com/febuiles/pamela for usage information.
|
28
|
+
email: federico.builes@gmail.com
|
29
|
+
executables: []
|
30
|
+
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files: []
|
34
|
+
|
35
|
+
files:
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- lib/pamela/pamela.rb
|
39
|
+
- lib/pamela/version.rb
|
40
|
+
- lib/pamela.rb
|
41
|
+
has_rdoc: true
|
42
|
+
homepage: http://github.com/febuiles/pamela
|
43
|
+
licenses: []
|
44
|
+
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: "0"
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.5.0
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Pamela is your personal Rake assistant.
|
69
|
+
test_files: []
|
70
|
+
|