neruda 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7b04958f3e5482160f89ecc7fda88258c6fc521
4
- data.tar.gz: 0b534ba550a1a09068e39b37ee7194e45a22c54b
3
+ metadata.gz: d27ec419fef855a84bea4e91b9330fbbe659e97c
4
+ data.tar.gz: 7a996318f08fdb881e941c321b67a958ddeaa845
5
5
  SHA512:
6
- metadata.gz: b16aa22a09ca945a513280104244b20298e9a2fb7d992d41ceb65479bd9307a8053778e804d5c0daae0371825e2b2f5762373bd0a34035f747a71894d21e35ad
7
- data.tar.gz: 26992b799de7fcbada2dfc2bc1e0f624d13f806c77ebd43fa0c96595bce5b06a5eccee5c46051003a0d8f5955774066582128719b593f69610cb0079612a6eff
6
+ metadata.gz: 98b930b09fcb112273e61df48f5d39795b914c93ac1a1f69de41aa1097ac7cdb523944d4d31d21c77ec8caed9fb6086d8cfc7464ff73b20cb7a925cf3cc3abd5
7
+ data.tar.gz: 209f225bc0ccd7f5dfb949d49ddbbfbbd496136a0bbbc481e307564a6543eb7ffbe8462774037016bddaf480671c9ceb4aa1ef73257423a2a4bea6a9dd6bd8b9
data/bin/pablo CHANGED
@@ -17,10 +17,11 @@ module BundlerHelper
17
17
  false
18
18
  end
19
19
 
20
- def rake_or_bundle_run(cmd)
20
+ def rake_or_bundle_run(cmd, use_system = false)
21
21
  cmd.insert(1, '-s') unless @options[:verbose]
22
22
  cmd = ['bundle', 'exec'] + cmd if bundler_is_present?
23
23
  puts Rainbow(cmd.join(' ')).blue if @options[:verbose]
24
+ return cmd.join(' ') if use_system
24
25
  exec(*cmd)
25
26
  end
26
27
  end
@@ -148,8 +149,8 @@ class Pablo
148
149
  rake_or_bundle_run ['rake', 'sinatra:stop']
149
150
 
150
151
  elsif ARGV[0] == 'compile'
151
- rake_or_bundle_run ['rake', 'chapters:build_epubs']
152
- # rake_or_bundle_run ['rake', 'book:make']
152
+ rake_or_bundle_run ['rake', 'chapters:build_epubs'], true
153
+ rake_or_bundle_run ['rake', 'book:make']
153
154
 
154
155
  elsif ARGV[0] == 'new'
155
156
  new_chapter
@@ -188,7 +189,8 @@ class Pablo
188
189
  start : Start the rack web server (default is thin)
189
190
  stop : Stop the web server
190
191
  compile: Generate the epubs files
191
- list : List various book elements
192
+ list : List various book elements (chapters, characters, notes, sceneries)
193
+ board : Open your TiddlyWiki file located at ./private/notes/tiddly.html
192
194
 
193
195
  Chapters related commands:
194
196
  new [title] : Create a new chapter
@@ -268,6 +270,7 @@ class Pablo
268
270
  def list
269
271
  if ARGV[1].nil?
270
272
  STDERR.puts Rainbow('ERROR: No list type given.').red
273
+ STDERR.puts 'Enter one of [chapters, characters, notes, sceneries].'
271
274
  exit 1
272
275
  end
273
276
  rake_or_bundle_run ['rake', "book:list[#{ARGV[1]}]"]
data/lib/tasks/book.rake CHANGED
@@ -5,9 +5,10 @@ require 'rainbow'
5
5
 
6
6
  namespace :book do
7
7
  desc 'List various book elements'
8
- task :list, :list_type do |t, args|
8
+ task :list, :list_type do |_, args|
9
9
  list_type = args[:list_type]
10
- next unless ['chapters', 'characters', 'sceneries'].include?(list_type)
10
+ next unless ['chapters', 'characters',
11
+ 'notes', 'sceneries'].include?(list_type)
11
12
  Dir.glob("private/#{list_type}/*.org") do |filename|
12
13
  file_radix = File.basename(filename, '.org')
13
14
  title = file_radix.split('_').map(&:capitalize).join(' ')
@@ -39,10 +40,10 @@ namespace :book do
39
40
  filename = "private/chapters/#{file_radix}.org"
40
41
  next unless File.exist? filename
41
42
  file_content = IO.read(filename)
42
- file_content.gsub!(/^#\+date:.*$/mi, '')
43
- file_content.gsub!(/^#\+author:.*$/mi, '')
44
- file_content.gsub!(/^(\*+)\s+(.*)$/mi, '*\1 \2')
45
- file_content.gsub!(/^#\+title:\s?(.*)$/mi, '* \1')
43
+ file_content.gsub!(/^#\+date:.*$/i, '')
44
+ file_content.gsub!(/^#\+author:.*$/i, '')
45
+ file_content.gsub!(/^(\*+)\s+(.*)$/i, '*\1 \2')
46
+ file_content.gsub!(/^#\+title:\s?(.*)$/i, '* \1')
46
47
 
47
48
  org_file.write(file_content + "\n")
48
49
  end
@@ -45,7 +45,7 @@ namespace :chapters do
45
45
  file_radix = File.basename(filename, '.org')
46
46
  epub_file = "private/epubs/#{file_radix}.epub"
47
47
  epub_to_upload << epub_file
48
- sh 'pandoc', '-S', "-o #{epub_file}", filename
48
+ sh 'pandoc', '-S', "--output=#{epub_file}", filename
49
49
  end
50
50
  next if epub_to_upload.empty?
51
51
  IO.write('tmp/epub_to_upload.yml', epub_to_upload.to_yaml)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neruda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Étienne Deparis