caramelize 0.0.1 → 0.0.2
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.
File without changes
|
@@ -30,9 +30,19 @@ module Caramelize::CLI
|
|
30
30
|
|
31
31
|
# TODO create dummy config file
|
32
32
|
|
33
|
-
|
33
|
+
puts "Created new configuration file: caramelize.rb"
|
34
|
+
#puts args[0]
|
34
35
|
require 'fileutils'
|
35
|
-
|
36
|
+
|
37
|
+
FileUtils.cp(File.dirname(__FILE__) +"/../caramel.rb", args[0])
|
38
|
+
|
39
|
+
#File.open('caremelize.rb',"w+") do |f|
|
40
|
+
# f << "query_data"
|
41
|
+
#end
|
42
|
+
|
43
|
+
rescue
|
44
|
+
#require 'fileutils'
|
45
|
+
#FileUtils.rm_rf(args[0])
|
36
46
|
raise
|
37
47
|
end
|
38
48
|
if commandparser.verbosity == :verbose
|
data/lib/caramelize/cli.rb
CHANGED
@@ -30,7 +30,7 @@ module Caramelize
|
|
30
30
|
self.program_version = Caramelize::VERSION
|
31
31
|
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
32
32
|
opts.separator "Global options:"
|
33
|
-
opts.on("--config DIR", "-d", String, "The config file (default: caramel.
|
33
|
+
opts.on("--config DIR", "-d", String, "The config file (default: caramel.rb)") {|p| @directory = p}
|
34
34
|
opts.on("--verbose", "-v", "Print more output") { @verbosity = :verbose }
|
35
35
|
opts.on("--quiet", "-q", "No output") { @verbosity = :quiet }
|
36
36
|
end
|
@@ -46,24 +46,11 @@ module Caramelize
|
|
46
46
|
possible_files.detect{|f| File.exists?(f)}
|
47
47
|
end
|
48
48
|
|
49
|
-
# Utility method for sub-commands to create a default config file
|
50
|
-
def create_config
|
51
|
-
# TODO create dummy config
|
52
|
-
#if !defined?(@website)
|
53
|
-
#@config = Webgen::Website.new(@directory) do |config|
|
54
|
-
# config['logger.mask'] = @log_filter
|
55
|
-
#end
|
56
|
-
#end
|
57
|
-
#@config
|
58
|
-
end
|
59
|
-
|
60
49
|
# Utility method for sub-commands to transfer wiki contents
|
61
50
|
def transfer_content
|
62
|
-
# TODO maybe move to mixin
|
63
51
|
|
64
52
|
time_start = Time.now
|
65
53
|
|
66
|
-
# TODO outsource to config
|
67
54
|
file = detect_configuration_file
|
68
55
|
if file && File.exists?(file)
|
69
56
|
instance_eval(File.read(file), file || '<eval>')
|
data/lib/caramelize/version.rb
CHANGED
data/lib/caramelize/wiki.rb
CHANGED
@@ -4,10 +4,6 @@ module Caramelize
|
|
4
4
|
include DatabaseConnector
|
5
5
|
attr_accessor :revisions, :wiki_title, :titles, :description
|
6
6
|
|
7
|
-
#def initialize revisions
|
8
|
-
# @revisions = revisions
|
9
|
-
#end
|
10
|
-
|
11
7
|
def initialize options={}
|
12
8
|
@options = options
|
13
9
|
end
|
@@ -26,8 +22,7 @@ module Caramelize
|
|
26
22
|
end
|
27
23
|
|
28
24
|
def convert_syntax?
|
29
|
-
|
30
|
-
true
|
25
|
+
@options[:syntax] == :markdown
|
31
26
|
end
|
32
27
|
|
33
28
|
def latest_revisions
|
@@ -13,13 +13,12 @@ module Caramelize
|
|
13
13
|
#str.gsub!(/(===)(.*?)(===)/) {|s| '`' + $2 + '`'} #code
|
14
14
|
str.gsub!(/(__)(.*?)(__)/) {|s| '<u>' + $2 + '</u>'} #underline
|
15
15
|
|
16
|
-
str.gsub!(/(.*?)(\n\t-)(.*?)/) {|s| $1 + '\n' + $3 } #list
|
16
|
+
#str.gsub!(/(.*?)(\n\t-)(.*?)/) {|s| $1 + '\n' + $3 } #list
|
17
17
|
|
18
|
-
|
18
|
+
str.gsub!(/(\t-)(.*?)/) {|s| '*' + $2 } #list
|
19
19
|
#str.gsub!(/(----)/) {|s| '~~~~'} #seperator
|
20
20
|
|
21
21
|
|
22
|
-
|
23
22
|
# TODO more syntax conversion for links and images
|
24
23
|
|
25
24
|
str
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caramelize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-15 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mysql2
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156383180 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156383180
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: cmdparse
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156380360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156380360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: gollum
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156379560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 1.3.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156379560
|
47
47
|
description: By defining the access from the input to the output wiki you can migrate
|
48
48
|
any wiki.
|
49
49
|
email:
|
@@ -60,9 +60,9 @@ files:
|
|
60
60
|
- README.md
|
61
61
|
- Rakefile
|
62
62
|
- bin/caramelize
|
63
|
-
- caramel.rb
|
64
63
|
- caramelize.gemspec
|
65
64
|
- lib/caramelize/author.rb
|
65
|
+
- lib/caramelize/caramel.rb
|
66
66
|
- lib/caramelize/cli.rb
|
67
67
|
- lib/caramelize/cli/create_command.rb
|
68
68
|
- lib/caramelize/cli/run_command.rb
|