tlapse 0.4.0 → 0.4.1

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
2
  SHA256:
3
- metadata.gz: d5324eb4dc3078f4ce71933e39fadba6b168243606f404a4fac865f081981dd3
4
- data.tar.gz: aeecbd51f6052e1106bb1429e29b0d8db8bf7e3b0907a48a769924825322ca75
3
+ metadata.gz: 095c172778da6f3d7aaf66156127eeac47d0413bbcf888b8288ed2d670024676
4
+ data.tar.gz: 268453b146950a3bd23935fd1f5f777fb0f3934ea8b1893139f5146de2fca496
5
5
  SHA512:
6
- metadata.gz: 918714a48a19b48ebbd9618346d9ef0ba81d3564d7156334721262b79568c74e32b491b726b6ba8e66e6a8b7d2a96961ef27db0b89bde9bc4a564056d2727a4e
7
- data.tar.gz: 345676c5fe6a67c88e2729c02873a6070f972f41f49c4b11d5474d6529855eb68aba6f5c138a8a8c907cf3ef7764dd82011acd5534c2d7fc1a2ff2779973efb5
6
+ metadata.gz: f83789b0cd13f58a8be385a8d10d920e5912154d13b699dc1902ba80e5e4e44ea800936b4ccc09e075d785f8f5bee5bf6985afc0b32233503617766f47a26fe7
7
+ data.tar.gz: 97586ce4a34be667779a17333df117139575ed557c591de9d3f9528f01e73cb3cc26826fa18e88908c31ea0d25932e2460375714606c6b1d92c075d787981b95
data/README.md CHANGED
@@ -9,13 +9,22 @@ Automated time lapse photography using gphoto2.
9
9
  * macOS: `brew install gphoto2`
10
10
  * Debian/Ubuntu: `sudo apt install gphoto2`
11
11
 
12
- 2. `gem install tlapse` or add `gem 'tlapse'` to your `Gemfile`.
12
+ 2. `gem install tlapse`
13
+
14
+ ## Example: Integrate with cron
15
+
16
+ * From 9 AM to sunset, capture one image every 10 minutes
17
+
18
+ ```
19
+ 0 9 * * * cd $HOME && eval "$(tlapse until_sunset --interval 10)" >> capture.log
20
+ ```
13
21
 
14
22
  ## CLI
15
23
 
16
24
  Find better documentation by running `tlapse help` or `tlapse help SUBCOMMAND`
17
25
 
18
26
  * `tlapse capture` - Capture an image using the tethered camera
27
+ * `tlapse until_sunset` - Generate a gphoto2 command which captures images until sunset
19
28
 
20
29
  ## API
21
30
 
@@ -27,13 +36,13 @@ Mostly useful for cronjobs and the like.
27
36
  from: Time.now,
28
37
  to: Time.now + 6.hours,
29
38
  interval: 30.minutes
30
- }) # => "gphoto2 --capture-image-and-download -I 1800 -F 12 --filename \"%Y-%m-%d_%H-%M-%S.jpg\""
39
+ }) # => "gphoto2 --capture-image-and-download -I 1800 -F 12 --filename '%Y-%m-%d_%H-%M-%S.jpg'"
31
40
  ```
32
41
 
33
42
  * Capture images from sunset to sunrise
34
43
  ```ruby
35
44
  Tlapse::Capture.timelapse_command_while_sun_is_up(interval: 30.minutes)
36
- # => "gphoto2 --capture-image-and-download -I 1800 -F -9"
45
+ # => "gphoto2 --capture-image-and-download -I 1800 -F 11 --filename '%Y-%m-%d_%H-%M-%S.jpg'"
37
46
  ```
38
47
 
39
48
  ## License
@@ -2,10 +2,15 @@ require "active_support/core_ext/numeric/time.rb"
2
2
 
3
3
  module Tlapse
4
4
  module Capture
5
- def self.capture_single(format: nil)
6
- puts "The format key is not yet supported" if format
7
5
 
8
- `gphoto2 --capture-image-and-download`
6
+ CAPTURE_FILENAME = "%Y-%m-%d_%H-%M-%S.jpg"
7
+
8
+ def self.capture_filename
9
+ CAPTURE_FILENAME
10
+ end
11
+
12
+ def self.capture_single
13
+ `gphoto2 --capture-image-and-download --filename '#{capture_filename}'`
9
14
  end
10
15
 
11
16
  ##
@@ -50,7 +55,7 @@ module Tlapse
50
55
  command = "gphoto2 --capture-image-and-download"
51
56
  command += " -I #{interval}"
52
57
  command += " -F #{captures}"
53
- command += ' --filename "%Y-%m-%d_%H-%M-%S.jpg"'
58
+ command += " --filename '#{capture_filename}'"
54
59
  end
55
60
 
56
61
  ##
@@ -71,7 +76,7 @@ module Tlapse
71
76
  end_time: sunset,
72
77
  interval: interval
73
78
  )
74
- "gphoto2 --capture-image-and-download -I #{interval} -F #{captures}"
79
+ "gphoto2 --capture-image-and-download -I #{interval} -F #{captures} --filename '#{capture_filename}'"
75
80
  end
76
81
  end # Capture
77
82
  end # Tlapse
@@ -1,3 +1,3 @@
1
1
  module Tlapse
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tlapse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Toniazzo