comtec-dr 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +92 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/comtec-dr.gemspec +27 -0
- data/lib/comtec-dr.rb +7 -0
- data/lib/comtec-dr/mov_demuxer.rb +20 -0
- data/lib/comtec-dr/udat_analyzer.rb +22 -0
- data/lib/comtec-dr/version.rb +6 -0
- metadata +99 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a7e5e2efb1839024b647e1b4e77ff5aa53fd35a1
|
4
|
+
data.tar.gz: e3b2a4f6889b4cd28f959ab91e6fc1abb0e1a762
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bf682caf491ee6a9c87f58a9aa42bad38d288d4f174701adafdacd51b90ba8925300bdce54b93d86bbb4c3fa0787a85478b7a95b73db9f1a278492fc1d8e7c84
|
7
|
+
data.tar.gz: 012c9d5a2efa6d7432cf85ac640903ef6b98d9b880ff4bc3b2e7219966c22210321bc04a9830afe0443c2521e4154e3e05086f45ae34155e915fd51f65089e79
|
data/.gitignore
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
|
11
|
+
# Created by https://www.gitignore.io/api/ruby,osx
|
12
|
+
|
13
|
+
### OSX ###
|
14
|
+
*.DS_Store
|
15
|
+
.AppleDouble
|
16
|
+
.LSOverride
|
17
|
+
|
18
|
+
# Icon must end with two \r
|
19
|
+
Icon
|
20
|
+
|
21
|
+
# Thumbnails
|
22
|
+
._*
|
23
|
+
|
24
|
+
# Files that might appear in the root of a volume
|
25
|
+
.DocumentRevisions-V100
|
26
|
+
.fseventsd
|
27
|
+
.Spotlight-V100
|
28
|
+
.TemporaryItems
|
29
|
+
.Trashes
|
30
|
+
.VolumeIcon.icns
|
31
|
+
.com.apple.timemachine.donotpresent
|
32
|
+
|
33
|
+
# Directories potentially created on remote AFP share
|
34
|
+
.AppleDB
|
35
|
+
.AppleDesktop
|
36
|
+
Network Trash Folder
|
37
|
+
Temporary Items
|
38
|
+
.apdisk
|
39
|
+
|
40
|
+
### Ruby ###
|
41
|
+
*.gem
|
42
|
+
*.rbc
|
43
|
+
/.config
|
44
|
+
/coverage/
|
45
|
+
/InstalledFiles
|
46
|
+
/pkg/
|
47
|
+
/spec/reports/
|
48
|
+
/spec/examples.txt
|
49
|
+
/test/tmp/
|
50
|
+
/test/version_tmp/
|
51
|
+
/tmp/
|
52
|
+
|
53
|
+
# Used by dotenv library to load environment variables.
|
54
|
+
# .env
|
55
|
+
|
56
|
+
## Specific to RubyMotion:
|
57
|
+
.dat*
|
58
|
+
.repl_history
|
59
|
+
build/
|
60
|
+
*.bridgesupport
|
61
|
+
build-iPhoneOS/
|
62
|
+
build-iPhoneSimulator/
|
63
|
+
|
64
|
+
## Specific to RubyMotion (use of CocoaPods):
|
65
|
+
#
|
66
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
67
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
68
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
69
|
+
#
|
70
|
+
# vendor/Pods/
|
71
|
+
|
72
|
+
## Documentation cache and generated files:
|
73
|
+
/.yardoc/
|
74
|
+
/_yardoc/
|
75
|
+
/doc/
|
76
|
+
/rdoc/
|
77
|
+
|
78
|
+
## Environment normalization:
|
79
|
+
/.bundle/
|
80
|
+
/vendor/bundle
|
81
|
+
/lib/bundler/man/
|
82
|
+
|
83
|
+
# for a library or gem, you might want to ignore these files since the code is
|
84
|
+
# intended to run in multiple environments; otherwise, check them in:
|
85
|
+
# Gemfile.lock
|
86
|
+
# .ruby-version
|
87
|
+
# .ruby-gemset
|
88
|
+
|
89
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
90
|
+
.rvmrc
|
91
|
+
|
92
|
+
# End of https://www.gitignore.io/api/ruby,osx
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Shogo Kawaguchi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# ComtecDr
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/comtec_dr`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'comtec_dr'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install comtec_dr
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/comtec_dr.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "comtec-dr"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/comtec-dr.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "comtec-dr/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "comtec-dr"
|
8
|
+
spec.version = ComtecDR::VERSION
|
9
|
+
spec.authors = ["Shogo Kawaguchi"]
|
10
|
+
spec.email = ["platycod0n.ramosa@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{comtec drive recorder analyzer}
|
13
|
+
spec.description = %q{comtec drive recorder analyzer}
|
14
|
+
spec.homepage = "https://github.com/k-shogo/comtec-dr"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
27
|
+
end
|
data/lib/comtec-dr.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module ComtecDR
|
2
|
+
class MovDemuxer
|
3
|
+
class << self
|
4
|
+
def demux mov_path
|
5
|
+
io = File.open mov_path
|
6
|
+
|
7
|
+
while length = io.read(4)
|
8
|
+
size = length.unpack('H*').first.to_i(16)
|
9
|
+
seek = size - 8
|
10
|
+
code = io.read(4)
|
11
|
+
if code == 'udat'
|
12
|
+
return io.read(seek)
|
13
|
+
else
|
14
|
+
io.seek(seek, IO::SEEK_CUR)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ComtecDR
|
2
|
+
class UdatAnalyzer
|
3
|
+
LOG_PATTERN = /
|
4
|
+
A
|
5
|
+
(?<lat>[\d.]*)(?<lat_sign>[NS])
|
6
|
+
(?<lon>[\d.]*)(?<lon_sign>[EW])
|
7
|
+
(?<speed>\d{4})
|
8
|
+
(?<jst>\d{12})
|
9
|
+
(?:\s+?)
|
10
|
+
(?<time>\d{5})
|
11
|
+
(?<x_acceleration>[\d-]{1}\d{4})
|
12
|
+
(?<y_acceleration>[\d-]{1}\d{4})
|
13
|
+
(?<z_acceleration>[\d-]{1}\d{4})
|
14
|
+
/x
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def analyze udat
|
18
|
+
udat.gsub(/[[:cntrl:]]/,"").scan(LOG_PATTERN)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: comtec-dr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shogo Kawaguchi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
description: comtec drive recorder analyzer
|
56
|
+
email:
|
57
|
+
- platycod0n.ramosa@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
70
|
+
- comtec-dr.gemspec
|
71
|
+
- lib/comtec-dr.rb
|
72
|
+
- lib/comtec-dr/mov_demuxer.rb
|
73
|
+
- lib/comtec-dr/udat_analyzer.rb
|
74
|
+
- lib/comtec-dr/version.rb
|
75
|
+
homepage: https://github.com/k-shogo/comtec-dr
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.6.13
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: comtec drive recorder analyzer
|
99
|
+
test_files: []
|