codemerger 0.2.0 → 0.2.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.markdown +53 -0
- data/codemerger.gemspec +18 -2
- data/lib/codemerger/version.rb +1 -1
- metadata +11 -8
- data/README.rdoc +0 -1
data/README.markdown
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
This gem is used to help writing technical posts for wordpress.
|
2
|
+
|
3
|
+
To use this GEM I usually create a new directory for the post or post group project, then I create a Gemfile like this:
|
4
|
+
|
5
|
+
source "http://rubygems.org"
|
6
|
+
group :rake do
|
7
|
+
gem "codemerger", "0.1.0", :require => "codemerger/rake_tasks"
|
8
|
+
end
|
9
|
+
|
10
|
+
After that I create a Rakefile like this:
|
11
|
+
|
12
|
+
require "rubygems"
|
13
|
+
require "bundler/setup"
|
14
|
+
Bundler.require :rake
|
15
|
+
|
16
|
+
Then just start creating the post file in the root directory, the project supports .html or .markdown files for the posts.
|
17
|
+
Inside this file, when I want to include a source sample, I create another file for the sample, and then I include it into the main post file with a code like this:
|
18
|
+
|
19
|
+
{{full/path/to/the/file.rb}}
|
20
|
+
|
21
|
+
When the post is ready I run teh rake task:
|
22
|
+
|
23
|
+
rake codemerger:merge
|
24
|
+
|
25
|
+
After that, the file I was writting is processed, a new file is created into the output directory and the sample source files are included with a code like this:
|
26
|
+
|
27
|
+
<b>{{full/path/to/the/file.rb}}</b>
|
28
|
+
<pre line="1" lang="ruby">
|
29
|
+
ruby code
|
30
|
+
</pre>
|
31
|
+
|
32
|
+
This snippet is then copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.
|
33
|
+
|
34
|
+
Today this gem supports source files in the following languages:
|
35
|
+
|
36
|
+
* Ruby (including Rakefile and Gemfile)
|
37
|
+
* Java
|
38
|
+
* YAML
|
39
|
+
* HTML
|
40
|
+
* XML
|
41
|
+
* Scala
|
42
|
+
* CSS
|
43
|
+
* Javascript
|
44
|
+
* Bash
|
45
|
+
* Batch
|
46
|
+
|
47
|
+
All other files are configured as "text".
|
48
|
+
|
49
|
+
For the next steps I'm planning to write more automated tests, refactor the language support code out, today it is a switch statement to convert from a file extension to a name supported by wp-syntax/Geshi and add support for templates and direct conversion of the source samples to colored HTML.
|
50
|
+
|
51
|
+
All these changes are simple, but besides the automated tests, I do not need any of the other right now, if you think they will be usefull for you, send me a message, file an enhancement request or fork, implement and send me a pull request.
|
52
|
+
|
53
|
+
Any testing or comments will be of great value, today, I think only I'm using this GEM.
|
data/codemerger.gemspec
CHANGED
@@ -8,9 +8,25 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Rodrigo Urubatan"]
|
10
10
|
s.email = ["rodrigo@urubatan.com.br"]
|
11
|
-
s.homepage = "
|
11
|
+
s.homepage = "https://github.com/urubatan/codemerger"
|
12
12
|
s.summary = %q{Used to create blog posts and tecnical articles that need code samples, the code samples will be taken from the actual source code file instead of a copy paste approach}
|
13
|
-
s.description = %q{
|
13
|
+
s.description = %q{This gem is used to help writing technical posts for wordpress.
|
14
|
+
The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.
|
15
|
+
|
16
|
+
Today this gem supports source files in the following languages:
|
17
|
+
|
18
|
+
* Ruby (including Rakefile and Gemfile)
|
19
|
+
* Java
|
20
|
+
* YAML
|
21
|
+
* HTML
|
22
|
+
* XML
|
23
|
+
* Scala
|
24
|
+
* CSS
|
25
|
+
* Javascript
|
26
|
+
* Bash
|
27
|
+
* Batch
|
28
|
+
|
29
|
+
All other files are configured as "text".}
|
14
30
|
|
15
31
|
s.rubyforge_project = "codemerger"
|
16
32
|
s.add_dependency 'maruku'
|
data/lib/codemerger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codemerger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease: !!null
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable: !!null
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: maruku
|
17
|
-
requirement: &
|
17
|
+
requirement: &19950852 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,13 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
26
|
-
description:
|
27
|
-
|
28
|
-
|
25
|
+
version_requirements: *19950852
|
26
|
+
description: ! "This gem is used to help writing technical posts for wordpress.\n
|
27
|
+
\ The output is copied and pasted to a post into my wordpress blog, and the code
|
28
|
+
gets colored using the plugin wp-syntax, and the output can be turned into PDF with
|
29
|
+
the plugin wp-mpdf.\n\nToday this gem supports source files in the following languages:\n\n*
|
30
|
+
Ruby (including Rakefile and Gemfile)\n* Java\n* YAML\n* HTML\n* XML\n* Scala\n*
|
31
|
+
CSS\n* Javascript\n* Bash\n* Batch\n\nAll other files are configured as \"text\"."
|
29
32
|
email:
|
30
33
|
- rodrigo@urubatan.com.br
|
31
34
|
executables: []
|
@@ -37,14 +40,14 @@ files:
|
|
37
40
|
- .gitignore
|
38
41
|
- Gemfile
|
39
42
|
- Gemfile.lock
|
40
|
-
- README.
|
43
|
+
- README.markdown
|
41
44
|
- Rakefile
|
42
45
|
- codemerger.gemspec
|
43
46
|
- lib/codemerger.rb
|
44
47
|
- lib/codemerger/rake_tasks.rb
|
45
48
|
- lib/codemerger/version.rb
|
46
49
|
has_rdoc: true
|
47
|
-
homepage:
|
50
|
+
homepage: https://github.com/urubatan/codemerger
|
48
51
|
licenses: []
|
49
52
|
post_install_message: !!null
|
50
53
|
rdoc_options: []
|
data/README.rdoc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
This project is used to help writing technical posts for wordpress.
|