halation 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/doc/Halation.html +2 -2
- data/doc/Halation/Coerce.html +1 -1
- data/doc/Halation/Config.html +1 -1
- data/doc/Halation/Config/Camera.html +1 -1
- data/doc/Halation/Config/Lens.html +1 -1
- data/doc/Halation/Engine.html +5 -11
- data/doc/Halation/ExifToolImage.html +1 -1
- data/doc/Halation/Roll.html +122 -46
- data/doc/Halation/Roll/Frame.html +111 -37
- data/doc/Halation/Script.html +75 -26
- data/doc/_index.html +1 -1
- data/doc/file.LICENSE.html +1 -1
- data/doc/file.README.html +11 -2
- data/doc/index.html +11 -2
- data/doc/method_list.html +40 -24
- data/doc/top-level-namespace.html +1 -1
- data/lib/halation/engine.rb +14 -6
- data/lib/halation/roll.rb +10 -4
- data/lib/halation/roll/frame.rb +6 -3
- data/lib/halation/script.rb +25 -18
- data/lib/halation/version.rb +1 -1
- metadata +5 -5
data/lib/halation/roll.rb
CHANGED
@@ -9,8 +9,12 @@ module Halation
|
|
9
9
|
attr_reader :artist
|
10
10
|
# Copyright for the roll of film.
|
11
11
|
attr_reader :copyright
|
12
|
-
# Default date
|
13
|
-
|
12
|
+
# Default date a frame was captured for all frames,
|
13
|
+
# in ISO 8601 format (optional).
|
14
|
+
attr_reader :date_captured
|
15
|
+
# Default date a frame was scanned (digitized) for all frames,
|
16
|
+
# in ISO 8601 format (optional).
|
17
|
+
attr_reader :date_scanned
|
14
18
|
# Tag of the cameara used.
|
15
19
|
attr_reader :camera
|
16
20
|
# Tag of the default lens used (optional).
|
@@ -28,7 +32,8 @@ module Halation
|
|
28
32
|
def reset
|
29
33
|
@artist = nil
|
30
34
|
@copyright = nil
|
31
|
-
@
|
35
|
+
@date_captured = nil
|
36
|
+
@date_scanned = nil
|
32
37
|
@camera = nil
|
33
38
|
@lens = nil
|
34
39
|
@iso = nil
|
@@ -42,7 +47,8 @@ module Halation
|
|
42
47
|
YAML.load_file(file_path).tap do |roll|
|
43
48
|
@artist = Coerce.string(roll["artist"])
|
44
49
|
@copyright = Coerce.string(roll["copyright"])
|
45
|
-
@
|
50
|
+
@date_captured = Coerce.date(roll["date_captured"])
|
51
|
+
@date_scanned = Coerce.date(roll["date_scanned"])
|
46
52
|
@camera = Coerce.string(roll["camera"])
|
47
53
|
@lens = Coerce.string(roll["lens"])
|
48
54
|
@iso = Coerce.integer(roll["iso"])
|
data/lib/halation/roll/frame.rb
CHANGED
@@ -6,8 +6,10 @@ module Halation
|
|
6
6
|
class Frame
|
7
7
|
# Frame number.
|
8
8
|
attr_reader :number
|
9
|
-
# Date the frame was captured in ISO 8601 format.
|
10
|
-
attr_reader :
|
9
|
+
# Date the frame was captured, in ISO 8601 format.
|
10
|
+
attr_reader :date_captured
|
11
|
+
# Date the frame was scanned (digitized), in ISO 8601 format.
|
12
|
+
attr_reader :date_scanned
|
11
13
|
# Tag of the lens used.
|
12
14
|
attr_reader :lens
|
13
15
|
# Focal length of the lens, if not specified by the lens profile
|
@@ -33,7 +35,8 @@ module Halation
|
|
33
35
|
|
34
36
|
def initialize(yaml)
|
35
37
|
@number = Coerce.integer(yaml["number"])
|
36
|
-
@
|
38
|
+
@date_captured = Coerce.date(yaml["date_captured"])
|
39
|
+
@date_scanned = Coerce.date(yaml["date_scanned"])
|
37
40
|
@lens = Coerce.string(yaml["lens"])
|
38
41
|
@focal_length = Coerce.integer(yaml["focal_length"])
|
39
42
|
@shutter = Coerce.string(yaml["shutter"])
|
data/lib/halation/script.rb
CHANGED
@@ -21,73 +21,78 @@ module Halation
|
|
21
21
|
|
22
22
|
options = {}
|
23
23
|
|
24
|
-
OptionParser.new { |
|
25
|
-
|
24
|
+
OptionParser.new { |op|
|
25
|
+
op.banner = "Usage: halation [options]"
|
26
26
|
|
27
|
-
|
27
|
+
op.on("-c", "--config=PATH", String, "Config file path") do |config_path|
|
28
28
|
options[:config_path] = config_path
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
op.on("--dry", "Dry run") do
|
32
32
|
options[:dry_run] = true
|
33
33
|
# TODO: Implement
|
34
34
|
raise NotImplementedError, "Dry run option is not yet implemented."
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
output_stream.puts
|
37
|
+
op.on("-h", "--help", "Print this help") do
|
38
|
+
output_stream.puts op
|
39
39
|
run_engine = false
|
40
40
|
exit unless skip_exit
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
op.on("--new-config", "Generate a new config file") do |path|
|
44
44
|
# TODO: Implement
|
45
45
|
raise NotImplementedError, "Generate config option is not yet implemented."
|
46
46
|
run_engine = false
|
47
47
|
exit unless skip_exit
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
generate_new_roll
|
50
|
+
op.on("--new-roll", "Generate a new roll.yml file") do
|
51
|
+
generate_new_roll(opts)
|
52
52
|
run_engine = false
|
53
53
|
exit unless skip_exit
|
54
54
|
end
|
55
55
|
|
56
|
-
|
56
|
+
op.on("-p", "--print-config", "Print the configuration settings") do
|
57
57
|
# TODO: Implement
|
58
58
|
raise NotImplementedError, "Print config option is not yet implemented."
|
59
59
|
run_engine = false
|
60
60
|
exit unless skip_exit
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
op.on("-r", "--recursive", "Traverse into subdirectories") do
|
64
64
|
# TODO: Implement
|
65
65
|
raise NotImplementedError, "Recursive option is not yet implemented."
|
66
66
|
end
|
67
67
|
|
68
|
-
|
68
|
+
op.on("--silent", "Suppress messages to stdout.") do
|
69
69
|
options[:silent] = true
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
op.on("-v", "--version", "Print the version information") do
|
73
73
|
output_stream.puts "halation #{Halation::VERSION}"
|
74
74
|
run_engine = false
|
75
75
|
exit unless skip_exit
|
76
76
|
end
|
77
77
|
}.parse!(args)
|
78
|
-
|
78
|
+
|
79
79
|
Halation::Engine.run(options) if run_engine
|
80
80
|
end
|
81
81
|
|
82
82
|
# Generate a new roll.yml file.
|
83
83
|
# Copies "~/.halation/templates/roll.yml" if it exists, otherwise it uses
|
84
84
|
# a default template.
|
85
|
-
|
85
|
+
#
|
86
|
+
# @option opts [Boolean] :skip_exit (false)
|
87
|
+
# Don't exit the program after calling a handler that would normally exit.
|
88
|
+
# Used for unit testing.
|
89
|
+
def self.generate_new_roll(opts = {})
|
90
|
+
skip_exit = !!opts[:skip_exit]
|
86
91
|
roll_path = "roll.yml"
|
87
92
|
|
88
93
|
if File.exists?(roll_path)
|
89
|
-
|
90
|
-
|
94
|
+
STDERR.puts "A roll.yml file already exists in this directory."
|
95
|
+
exit 1 unless skip_exit
|
91
96
|
end
|
92
97
|
|
93
98
|
# TODO: Make this configurable from config.yml
|
@@ -106,9 +111,11 @@ module Halation
|
|
106
111
|
|
107
112
|
# @return [String] roll.yml default content
|
108
113
|
def self.new_roll_content
|
114
|
+
today = Time.now.strftime("%Y-%m-%d")
|
109
115
|
output = <<YAML
|
110
116
|
---
|
111
|
-
|
117
|
+
date_captured: "#{today}"
|
118
|
+
date_scanned: "#{today}"
|
112
119
|
camera: "rz67"
|
113
120
|
lens: 110
|
114
121
|
iso: 100
|
data/lib/halation/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex McLain
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '3.
|
95
|
+
version: '3.9'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '3.
|
102
|
+
version: '3.9'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rspec-its
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '1.
|
109
|
+
version: '1.3'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '1.
|
116
|
+
version: '1.3'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: fivemat
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|