epuber 0.4.0 → 0.5.0.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 43b004b5cbf151d828970b67bdad742b4199629e
4
- data.tar.gz: f763945ec366475789ba83af1945393478beef8f
2
+ SHA256:
3
+ metadata.gz: 1090e1e950ac74304760e03e150f009c0b5dc2708140e09d7d0a59fa04e5047a
4
+ data.tar.gz: e297a29c815dcaea61a093d8697f94373b594a4140ad376b286fb0056239589a
5
5
  SHA512:
6
- metadata.gz: f99f327f37f466b5233d32b324b5ff47b71564c64f9a485fb9e4ae0d9070d4be61c23f1860341c5e7cbff0a16715de5d9592b978c786333d63cae6d7d77f11d2
7
- data.tar.gz: 95abd127c5d4c38a0fb12deaf728c44893014e36410a119e6b37000e3571fcc78b9268636ae0076fb30d3a6c55d291e7b3175b320fabd63551c07d712c6f924b
6
+ metadata.gz: 7d368f9fe3d25cd4042b7eb1e889a5dfef03c3c930c12e3365fc73b41ec77ed6d366f2e9c8c5a4698d616a6e2d0ab044b85288185061eb2887b810bbb35edc0f
7
+ data.tar.gz: d97488e6a9d0a2745fc92fd1906fc8bdae559eca59ae8ae9e6544bb1bc049e838a6886b75cabec9b86459019d466b676fa08e4c0ea9af8c1ea19d8e8d19a805a
data/epuber.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.add_runtime_dependency 'activesupport', '~> 5.0'
25
- spec.add_runtime_dependency 'nokogiri', '~> 1.6'
25
+ spec.add_runtime_dependency 'nokogiri', '~> 1.8.2'
26
26
  spec.add_runtime_dependency 'mime-types', '~> 3.0'
27
27
  spec.add_runtime_dependency 'claide', '~> 1.0'
28
28
  spec.add_runtime_dependency 'listen', '~> 3.0'
@@ -62,6 +62,7 @@ module Epuber
62
62
  #
63
63
  attr_accessor :book
64
64
 
65
+
65
66
  # @return [Epuber::Book] reference to book
66
67
  #
67
68
  def book
@@ -77,6 +78,23 @@ module Epuber
77
78
  #
78
79
  def sub_target(name)
79
80
  child = create_child_item(name)
81
+ child.book = self.book
82
+
83
+ yield child if block_given?
84
+
85
+ child
86
+ end
87
+
88
+ # Create new sub_target with name
89
+ #
90
+ # @param [String] name
91
+ #
92
+ # @return [Target] new created sub target
93
+ #
94
+ def sub_abstract_target(name)
95
+ child = create_child_item(name)
96
+ child.book = self.book
97
+ child.is_abstract = true
80
98
 
81
99
  yield child if block_given?
82
100
 
@@ -194,6 +212,12 @@ module Epuber
194
212
  types: [TrueClass, FalseClass],
195
213
  inherited: true
196
214
 
215
+ # @return [Bool] allows to create abstract targets that are only used as template for other targets
216
+ #
217
+ attribute :is_abstract,
218
+ types: [TrueClass, FalseClass],
219
+ inherited: false
220
+
197
221
 
198
222
  # @param file_path [String | Epuber::Book::File]
199
223
  # @param group [Symbol]
data/lib/epuber/book.rb CHANGED
@@ -94,6 +94,10 @@ module Epuber
94
94
  end
95
95
  end
96
96
 
97
+ def buildable_targets
98
+ flat_all_targets.select { |t| !t.is_abstract }
99
+ end
100
+
97
101
  # Defines new target
98
102
  #
99
103
  # @param [String, Symbol] name
@@ -107,6 +111,13 @@ module Epuber
107
111
  end
108
112
  end
109
113
 
114
+ def abstract_target(name)
115
+ @default_target.sub_abstract_target(name) do |target|
116
+ target.book = self
117
+ yield target if block_given?
118
+ end
119
+ end
120
+
110
121
  # Defines several new targets with same configuration
111
122
  #
112
123
  # @param [Array<String, Symbol>] names
@@ -107,7 +107,7 @@ module Epuber
107
107
 
108
108
  # when the list of targets is nil pick all available targets
109
109
  if targets.empty?
110
- book.all_targets
110
+ book.buildable_targets
111
111
  else
112
112
  targets.map { |target_name| book.target_named(target_name) }
113
113
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Epuber
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0.beta'
4
4
 
5
5
  HOME_URL = 'https://github.com/epuber-io/epuber'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epuber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kříž
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-13 00:00:00.000000000 Z
11
+ date: 2018-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: 1.8.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: 1.8.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mime-types
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -536,12 +536,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
536
536
  version: '2.2'
537
537
  required_rubygems_version: !ruby/object:Gem::Requirement
538
538
  requirements:
539
- - - ">="
539
+ - - ">"
540
540
  - !ruby/object:Gem::Version
541
- version: '0'
541
+ version: 1.3.1
542
542
  requirements: []
543
543
  rubyforge_project:
544
- rubygems_version: 2.6.12
544
+ rubygems_version: 2.7.4
545
545
  signing_key:
546
546
  specification_version: 4
547
547
  summary: Epuber is simple tool to compile and pack source files into EPUB format.