visionmedia-drupal 0.0.4 → 0.0.6
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/History.txt +13 -1
- data/Manifest.txt +1 -0
- data/README.txt +4 -2
- data/drupal.gemspec +3 -2
- data/lib/drupal.rb +3 -3
- data/lib/drupal/create_module.rb +1 -1
- data/lib/drupal/templates/hooks/cron +1 -1
- data/lib/drupal/templates/hooks/install +7 -0
- data/lib/drupal/templates/txt/changelog +1 -0
- data/lib/drupal/todo_list.rb +1 -1
- data/test/test_create_module.rb +1 -0
- data/test/test_drupal.rb +4 -2
- data/test/test_install.rb +23 -0
- metadata +3 -2
data/History.txt
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 0.0.6 / 2008-10-16
|
2
|
+
|
3
|
+
* 1 Minor Feature:
|
4
|
+
|
5
|
+
* Added hook_install() support
|
6
|
+
|
7
|
+
=== 0.0.5 / 2008-10-06
|
8
|
+
|
9
|
+
* 1 Minor Fix:
|
10
|
+
|
11
|
+
* Todo list was not parsing items starting with '@' in @todo
|
12
|
+
|
1
13
|
=== 0.0.4 / 2008-10-03
|
2
14
|
|
3
15
|
* 1 Major Feature:
|
@@ -19,5 +31,5 @@
|
|
19
31
|
|
20
32
|
=== 0.0.1 / 2008-09-27
|
21
33
|
|
22
|
-
* Initial release
|
34
|
+
* Initial release
|
23
35
|
|
data/Manifest.txt
CHANGED
@@ -11,6 +11,7 @@ lib/drupal/templates/comments/file
|
|
11
11
|
lib/drupal/templates/comments/large
|
12
12
|
lib/drupal/templates/hooks/block
|
13
13
|
lib/drupal/templates/hooks/boot
|
14
|
+
lib/drupal/templates/hooks/install
|
14
15
|
lib/drupal/templates/hooks/cron
|
15
16
|
lib/drupal/templates/hooks/form_alter
|
16
17
|
lib/drupal/templates/hooks/init
|
data/README.txt
CHANGED
@@ -45,14 +45,16 @@ to quickly generate and manage Drupal modules.
|
|
45
45
|
|
46
46
|
== TODO:
|
47
47
|
|
48
|
+
* Remove ':' from todo list items
|
48
49
|
* Add formatted help option
|
49
50
|
* Support versions for installer
|
50
51
|
* Support version prompt for project installation
|
51
52
|
* Support installing a list from file(s) so that devs may have lists of core modules they use
|
53
|
+
* Add hook dependencies
|
52
54
|
* Add installer for jQuery plugins?
|
53
55
|
* Add graceful error handling
|
54
|
-
* Add tests
|
55
|
-
* Refactor / encapsulate entire project
|
56
|
+
* Add / refactor tests, using rspec
|
57
|
+
* Refactor / encapsulate entire project / make extendable
|
56
58
|
|
57
59
|
== AUTHOR:
|
58
60
|
|
data/drupal.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "drupal"
|
3
|
-
s.version = "0.0.
|
4
|
-
s.date = "2008-10-
|
3
|
+
s.version = "0.0.6"
|
4
|
+
s.date = "2008-10-16"
|
5
5
|
s.summary = "Drupal development kit"
|
6
6
|
s.email = "tj@vision-media.ca"
|
7
7
|
s.homepage = "http://vision-media.ca/resources/drupal/drupal-module-builder-gem"
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
"lib/drupal/templates/comments/large",
|
23
23
|
"lib/drupal/templates/hooks/block",
|
24
24
|
"lib/drupal/templates/hooks/boot",
|
25
|
+
"lib/drupal/templates/hooks/install",
|
25
26
|
"lib/drupal/templates/hooks/cron",
|
26
27
|
"lib/drupal/templates/hooks/form_alter",
|
27
28
|
"lib/drupal/templates/hooks/init",
|
data/lib/drupal.rb
CHANGED
@@ -45,14 +45,14 @@
|
|
45
45
|
require 'optparse'
|
46
46
|
require 'ostruct'
|
47
47
|
require File.dirname(__FILE__) + '/drupal/create_module'
|
48
|
-
require File.dirname(__FILE__)
|
49
|
-
require File.dirname(__FILE__)
|
48
|
+
require File.dirname(__FILE__) + '/drupal/todo_list'
|
49
|
+
require File.dirname(__FILE__) + '/drupal/install'
|
50
50
|
|
51
51
|
class Drupal
|
52
52
|
|
53
53
|
MAJOR = 0
|
54
54
|
MINOR = 0
|
55
|
-
TINY =
|
55
|
+
TINY = 6
|
56
56
|
VERSION = [MAJOR, MINOR, TINY].join('.')
|
57
57
|
|
58
58
|
# Run the drupal development tool.
|
data/lib/drupal/create_module.rb
CHANGED
@@ -68,6 +68,7 @@ class Drupal
|
|
68
68
|
'boot',
|
69
69
|
'init',
|
70
70
|
'menu',
|
71
|
+
'install',
|
71
72
|
'schema',
|
72
73
|
'theme',
|
73
74
|
'form_alter',
|
@@ -78,7 +79,6 @@ class Drupal
|
|
78
79
|
# Create module from wizard results.
|
79
80
|
def create_module
|
80
81
|
puts "\n... Creating module '#{@module}' in '#{@dir}'"
|
81
|
-
# TODO: map hooks to specific order...usort equiv
|
82
82
|
# Base directory
|
83
83
|
create_dir("#{@module}")
|
84
84
|
self.create_module_dirs
|
data/lib/drupal/todo_list.rb
CHANGED
@@ -21,7 +21,7 @@ class Drupal
|
|
21
21
|
File.open(filepath) do |file|
|
22
22
|
items = []
|
23
23
|
file.each_line do |line|
|
24
|
-
matches = line.match /(
|
24
|
+
matches = line.match /(?:#|\/\/|\/\*|@)[\s]*todo:?[\s]*(.+)$/i
|
25
25
|
items << matches[1] unless matches.nil? || matches.length <= 0
|
26
26
|
@total += 1 unless matches.nil? || matches.length <= 0
|
27
27
|
end
|
data/test/test_create_module.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
|
data/test/test_drupal.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
|
3
2
|
require 'test/unit'
|
4
|
-
|
3
|
+
require File.dirname(__FILE__) + '/../lib/drupal.rb'
|
4
|
+
require File.dirname(__FILE__) + '/test_install.rb'
|
5
|
+
require File.dirname(__FILE__) + '/test_create_module.rb'
|
6
|
+
require File.dirname(__FILE__) + '/test_todo_list.rb'
|
data/test/test_install.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
class DrupalInstall < Test::Unit::TestCase
|
3
|
+
def setup
|
4
|
+
Drupal.new.run('install ab'.split)
|
5
|
+
Kernel.system "mkdir _modules"
|
6
|
+
Drupal.new.run('install devel ./_modules'.split)
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
Kernel.system "rm -fr ./ab/*"
|
11
|
+
Kernel.system "rmdir ./ab"
|
12
|
+
Kernel.system "rm -fr ./_modules/*"
|
13
|
+
Kernel.system "rmdir ./_modules"
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_contrib_cwd
|
17
|
+
assert(File.directory?('./ab'), 'Failed to install ab module in cwd.')
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_contrib_dir
|
21
|
+
assert(File.directory?('./_modules/devel'), 'Failed to install devel to _modules directory.')
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visionmedia-drupal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tj@vision-media.ca
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- lib/drupal/templates/comments/large
|
38
38
|
- lib/drupal/templates/hooks/block
|
39
39
|
- lib/drupal/templates/hooks/boot
|
40
|
+
- lib/drupal/templates/hooks/install
|
40
41
|
- lib/drupal/templates/hooks/cron
|
41
42
|
- lib/drupal/templates/hooks/form_alter
|
42
43
|
- lib/drupal/templates/hooks/init
|