calicli 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/CHANGELOG.md +5 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +95 -0
- data/README.md +35 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/calicli.gemspec +47 -0
- data/exe/calicli +5 -0
- data/lib/calicli/cli/base.rb +13 -0
- data/lib/calicli/cli.rb +139 -0
- data/lib/calicli/configuration.rb +41 -0
- data/lib/calicli/version.rb +5 -0
- data/lib/calicli.rb +36 -0
- data/lib/romana.rb +56 -0
- metadata +215 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 385a2f2778d3f7c6657f61eae2bf4421b77510f519b25f00c945455f9fcbbca0
|
4
|
+
data.tar.gz: 886c66d46f16da258e720da713485eb61d5c4bb77a544fadba01489574afd52d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '023873fe8228ca07f992a0c3dea76f2a9d2dda7f668706d78bb84b317574fa921a611b0284842fc8031e449ecef0da3e04b5f4a96f886b1df35621a4d1fb3183'
|
7
|
+
data.tar.gz: 5a3ead27e8a8167b25c7c3b13a53b0770042ad2e2587d3621d1fe5f5ef742369fe6d9b4a94673a55e940b6c4034ac4cca60462a2a1086b439e97cdd36c6fa4a0
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
calicli (0.1.0)
|
5
|
+
activerecord (~> 5.0.0)
|
6
|
+
activesupport (~> 5.0.0)
|
7
|
+
awesome_print
|
8
|
+
aws-sdk-s3
|
9
|
+
aws-sdk-sqs
|
10
|
+
jwt
|
11
|
+
mysql2
|
12
|
+
nokogiri
|
13
|
+
quick_store
|
14
|
+
rest-client
|
15
|
+
thor (~> 0.20)
|
16
|
+
|
17
|
+
GEM
|
18
|
+
remote: https://rubygems.org/
|
19
|
+
specs:
|
20
|
+
activemodel (5.0.7.2)
|
21
|
+
activesupport (= 5.0.7.2)
|
22
|
+
activerecord (5.0.7.2)
|
23
|
+
activemodel (= 5.0.7.2)
|
24
|
+
activesupport (= 5.0.7.2)
|
25
|
+
arel (~> 7.0)
|
26
|
+
activesupport (5.0.7.2)
|
27
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
28
|
+
i18n (>= 0.7, < 2)
|
29
|
+
minitest (~> 5.1)
|
30
|
+
tzinfo (~> 1.1)
|
31
|
+
arel (7.1.4)
|
32
|
+
awesome_print (1.9.2)
|
33
|
+
aws-eventstream (1.2.0)
|
34
|
+
aws-partitions (1.666.0)
|
35
|
+
aws-sdk-core (3.168.1)
|
36
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
37
|
+
aws-partitions (~> 1, >= 1.651.0)
|
38
|
+
aws-sigv4 (~> 1.5)
|
39
|
+
jmespath (~> 1, >= 1.6.1)
|
40
|
+
aws-sdk-kms (1.59.0)
|
41
|
+
aws-sdk-core (~> 3, >= 3.165.0)
|
42
|
+
aws-sigv4 (~> 1.1)
|
43
|
+
aws-sdk-s3 (1.117.1)
|
44
|
+
aws-sdk-core (~> 3, >= 3.165.0)
|
45
|
+
aws-sdk-kms (~> 1)
|
46
|
+
aws-sigv4 (~> 1.4)
|
47
|
+
aws-sdk-sqs (1.52.0)
|
48
|
+
aws-sdk-core (~> 3, >= 3.165.0)
|
49
|
+
aws-sigv4 (~> 1.1)
|
50
|
+
aws-sigv4 (1.5.2)
|
51
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
52
|
+
concurrent-ruby (1.1.10)
|
53
|
+
domain_name (0.5.20190701)
|
54
|
+
unf (>= 0.0.5, < 1.0.0)
|
55
|
+
http-accept (1.7.0)
|
56
|
+
http-cookie (1.0.5)
|
57
|
+
domain_name (~> 0.5)
|
58
|
+
i18n (1.12.0)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
jmespath (1.6.2)
|
61
|
+
jwt (2.5.0)
|
62
|
+
mime-types (3.4.1)
|
63
|
+
mime-types-data (~> 3.2015)
|
64
|
+
mime-types-data (3.2022.0105)
|
65
|
+
minitest (5.16.3)
|
66
|
+
mysql2 (0.5.4)
|
67
|
+
netrc (0.11.0)
|
68
|
+
nokogiri (1.13.9-arm64-darwin)
|
69
|
+
racc (~> 1.4)
|
70
|
+
quick_store (1.0.0)
|
71
|
+
racc (1.6.0)
|
72
|
+
rake (13.0.6)
|
73
|
+
rest-client (2.1.0)
|
74
|
+
http-accept (>= 1.7.0, < 2.0)
|
75
|
+
http-cookie (>= 1.0.2, < 2.0)
|
76
|
+
mime-types (>= 1.16, < 4.0)
|
77
|
+
netrc (~> 0.8)
|
78
|
+
thor (0.20.3)
|
79
|
+
thread_safe (0.3.6)
|
80
|
+
tzinfo (1.2.10)
|
81
|
+
thread_safe (~> 0.1)
|
82
|
+
unf (0.1.4)
|
83
|
+
unf_ext
|
84
|
+
unf_ext (0.0.8.2)
|
85
|
+
|
86
|
+
PLATFORMS
|
87
|
+
arm64-darwin-21
|
88
|
+
|
89
|
+
DEPENDENCIES
|
90
|
+
calicli!
|
91
|
+
minitest (~> 5.0)
|
92
|
+
rake (~> 13.0)
|
93
|
+
|
94
|
+
BUNDLED WITH
|
95
|
+
2.2.32
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Calicli
|
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/calicli`. 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 'calicli'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install calicli
|
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 the created tag, 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]/calicli.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "calicli"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/calicli.gemspec
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/calicli/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "calicli"
|
7
|
+
spec.version = Calicli::VERSION
|
8
|
+
spec.authors = ["Josef Sauter"]
|
9
|
+
spec.email = ["Josef.Sauter@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Calinda Sync Ops"
|
12
|
+
spec.description = "Calinda Sync Ops"
|
13
|
+
spec.homepage = "https://www.agilesd.com"
|
14
|
+
spec.required_ruby_version = ">= 2.6.0"
|
15
|
+
|
16
|
+
#spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://www.agilesd.com"
|
20
|
+
spec.metadata["changelog_uri"] = "https://www.agilesd.com"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
|
34
|
+
spec.add_dependency "thor", "~> 0.20"
|
35
|
+
spec.add_dependency "awesome_print"
|
36
|
+
spec.add_dependency 'activerecord', '~> 5.0.0'
|
37
|
+
spec.add_dependency 'activesupport', '~> 5.0.0'
|
38
|
+
spec.add_dependency "rest-client"
|
39
|
+
spec.add_dependency "nokogiri"
|
40
|
+
spec.add_dependency "aws-sdk-s3"
|
41
|
+
spec.add_dependency "aws-sdk-sqs"
|
42
|
+
spec.add_dependency 'jwt'
|
43
|
+
spec.add_dependency 'mysql2'
|
44
|
+
spec.add_dependency 'quick_store'
|
45
|
+
|
46
|
+
|
47
|
+
end
|
data/exe/calicli
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Calicli
|
2
|
+
module CLI
|
3
|
+
class Base < Thor
|
4
|
+
def self.banner(command, namespace = nil, subcommand = false)
|
5
|
+
"#{basename} #{subcommand_prefix} #{command.usage}"
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.subcommand_prefix
|
9
|
+
self.name.gsub(%r{.*::}, '').gsub(%r{^[A-Z]}) { |match| match[0].downcase }.gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/calicli/cli.rb
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
require_relative "cli/base"
|
4
|
+
|
5
|
+
module Calicli
|
6
|
+
module CLI
|
7
|
+
class App < Thor
|
8
|
+
desc "info", "show info"
|
9
|
+
def info
|
10
|
+
puts "CaliCli #{Calicli::VERSION}"
|
11
|
+
|
12
|
+
harvest_id = QuickStore.store.get(:harvest_id)
|
13
|
+
run_number =QuickStore.store.get(:run_number)
|
14
|
+
puts "Storage: harvest_id=#{harvest_id}, run_number=#{run_number}"
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "clean storage", "cleans the local storage"
|
18
|
+
def clean_storage
|
19
|
+
say "This is a destructive action. Type CLEAN to confirm your action"
|
20
|
+
clean = ask("Type CLEAN: ")
|
21
|
+
clean = clean.upcase
|
22
|
+
if clean.eql?("CLEAN")
|
23
|
+
QuickStore.store.delete(:harvest_id)
|
24
|
+
QuickStore.store.delete(:run_number)
|
25
|
+
say "Done", :green
|
26
|
+
else
|
27
|
+
say "No action.", :red
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "ribbons", "list ribbons"
|
32
|
+
def ribbons
|
33
|
+
puts "Ribbons: #{Ribbon.count}"
|
34
|
+
Ribbon.all.each do |r|
|
35
|
+
puts "#{r.iID_CINTA} => #{r.sCOLOR}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "blocks", "list blocks"
|
40
|
+
def blocks
|
41
|
+
puts "Blocks: #{Block.count}"
|
42
|
+
Block.find_each do |b|
|
43
|
+
puts "#{b.iID_BLOQUE} => #{b.sDESCRIPCION}"
|
44
|
+
puts " => #{b.areas.count}"
|
45
|
+
b.areas.each do |a|
|
46
|
+
puts " => #{a.sDESCRIPCION} : area=#{a.dAREA}, dist=#{a.dDISTANCIA}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
desc "sample_harvest", "print sample harvest data"
|
53
|
+
def sample_harvest
|
54
|
+
harvests = Harvest.where(iCARRERA: 1).limit(30)
|
55
|
+
harvests.each do |h|
|
56
|
+
puts "Entrega: #{h.iID_ENTREGA}"
|
57
|
+
puts "Viaje: #{h.iCARRERA}"
|
58
|
+
puts "Carrero: (#{h.user.iID_USUARIO}) #{h.user.sNOMBRE}"
|
59
|
+
puts "Capataz: (#{h.boss.iID_USUARIO}) #{h.boss.sNOMBRE}"
|
60
|
+
puts "Cable: (#{h.iID_AREA}) #{h.area.sDESCRIPCION}"
|
61
|
+
puts "Fecha: #{h.dtFECHA}"
|
62
|
+
puts "Cinta: (#{h.ribbon.iID_CINTA}) #{h.ribbon.sCOLOR}"
|
63
|
+
puts "Peso: #{h.dPESO} kg"
|
64
|
+
if h.evaluations.any?
|
65
|
+
puts "Evaluaciones:"
|
66
|
+
puts "================="
|
67
|
+
h.evaluations.each do |e|
|
68
|
+
puts " #{e.property.sDESCRIPCION_CORTA}: #{e.sDATO}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
puts "~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+\n"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
method_option :date
|
76
|
+
method_option :by_run, type: :boolean, default: false
|
77
|
+
method_option :mode, default: "last_processed"
|
78
|
+
method_option :run, type: :numeric
|
79
|
+
method_option :store, type: :boolean, default: true
|
80
|
+
desc "harvest", "process harvest info"
|
81
|
+
def harvest
|
82
|
+
date = options[:date]
|
83
|
+
batch_size = options[:batch_size]
|
84
|
+
last_processed = QuickStore.store.get(:harvest_id)
|
85
|
+
run_number = options[:run] || QuickStore.store.get(:run_number) || 1
|
86
|
+
by_run = options[:by_run]
|
87
|
+
puts "date=#{date}, by_run=#{by_run}, run_number=#{run_number}, last_processed=#{last_processed}".green
|
88
|
+
#{date: date, number: number, runner: runners.sample, cable: cable, arrive_at: arrive_at}
|
89
|
+
arel = Harvest
|
90
|
+
if date.present?
|
91
|
+
date = Time.parse(date).utc
|
92
|
+
puts "date=#{date.beginning_of_day} .... #{date.end_of_day}"
|
93
|
+
arel = arel.where(dtFECHA: date.beginning_of_day..date.end_of_day)
|
94
|
+
else last_processed
|
95
|
+
arel = arel.where("iID_ENTREGA > ?", last_proceseed)
|
96
|
+
end
|
97
|
+
|
98
|
+
if by_run
|
99
|
+
arel = arel.where(iCARRERA: run_number)
|
100
|
+
end
|
101
|
+
|
102
|
+
data = []
|
103
|
+
last_id = nil
|
104
|
+
last_run = nil
|
105
|
+
arel.each do |h|
|
106
|
+
|
107
|
+
x = {date: h.dtFECHA.beginning_of_day, arrive_at: h.dtFECHA, number: h.iCARRERA, runner: h.user.sNOMBRE, cable: h.area.sDESCRIPCION, color: h.ribbon.sCOLOR.downcase, weight: h.dPESO, ref: h.iID_ENTREGA}
|
108
|
+
e = h.evaluations.first
|
109
|
+
if e
|
110
|
+
x[:evaluation] = {}
|
111
|
+
x[:evaluation][e.property.sDESCRIPCION_CORTA] = e.sDATO
|
112
|
+
end
|
113
|
+
data << x
|
114
|
+
last_id = h.iID_ENTREGA
|
115
|
+
last_run = h.iCARRERA
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
begin
|
121
|
+
url = Calicli.config.erp_api_base + "/data"
|
122
|
+
resp = RestClient.post url, {data: data, data_type: "harvest"}.to_json, {content_type: :json, accept: :json, 'x-auth-token' => Calicli.config.erp_api_token}
|
123
|
+
if options[:store]
|
124
|
+
QuickStore.store.set(:harvest_id, last_id)
|
125
|
+
QuickStore.store.set(:run_number, (last_run + 1))
|
126
|
+
end
|
127
|
+
puts "OK".green
|
128
|
+
puts "last_id=#{last_id}, run_number=#{last_run}".green
|
129
|
+
rescue => e
|
130
|
+
puts "Error: #{e.message}".red
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'erb'
|
3
|
+
|
4
|
+
module Calicli
|
5
|
+
class Configuration
|
6
|
+
attr_accessor :active_record_config
|
7
|
+
attr_accessor :erp_api_base
|
8
|
+
attr_accessor :erp_api_token
|
9
|
+
attr_accessor :aws_key_id
|
10
|
+
attr_accessor :aws_secret
|
11
|
+
attr_accessor :aws_bucket
|
12
|
+
attr_accessor :sqs_key_id
|
13
|
+
attr_accessor :sqs_secret
|
14
|
+
attr_accessor :sqs_queue_url
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
config_file = "#{Calicli.app_directory}/config.yml"
|
18
|
+
if File.exist?(config_file)
|
19
|
+
template = ERB.new(File.read(config_file))
|
20
|
+
result = YAML.load(template.result(binding))
|
21
|
+
@active_record_config = result["active_record_config"]
|
22
|
+
@erp_api_base = result["erp_api_base"]
|
23
|
+
@erp_api_token = result["erp_api_token"]
|
24
|
+
|
25
|
+
@aws_key_id = result["aws_key_id"]
|
26
|
+
@aws_secret = result["aws_secret"]
|
27
|
+
@aws_bucket = result["aws_bucket"]
|
28
|
+
@sqs_key_id = result["sqs_key_id"]
|
29
|
+
@sqs_secret = result["sqs_secret"]
|
30
|
+
@sqs_queue_url = result["sqs_queue_url"]
|
31
|
+
|
32
|
+
QuickStore.configure do |config|
|
33
|
+
config.file_path = "#{Calicli.app_directory}/storage.yml"
|
34
|
+
end
|
35
|
+
else
|
36
|
+
raise Calicli::Error, "Configuration is missing. Make sure to create this file: #{config_file}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
data/lib/calicli.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/all"
|
4
|
+
require "awesome_print"
|
5
|
+
require "logger"
|
6
|
+
require "fileutils"
|
7
|
+
require "aws-sdk-s3"
|
8
|
+
require "aws-sdk-sqs"
|
9
|
+
require "rest-client"
|
10
|
+
require 'quick_store'
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
module Calicli
|
15
|
+
class Error < StandardError; end
|
16
|
+
|
17
|
+
def self.home_dir
|
18
|
+
Dir.home
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.app_directory
|
22
|
+
dir = File.join(Calicli.home_dir,".calicli")
|
23
|
+
FileUtils.mkdir_p dir unless File.exists?(dir)
|
24
|
+
dir
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.config
|
28
|
+
@config ||= Calicli::Configuration.new
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
require_relative "calicli/version"
|
34
|
+
require_relative "calicli/configuration"
|
35
|
+
require_relative "calicli/cli"
|
36
|
+
require_relative "romana"
|
data/lib/romana.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
ActiveRecord::Base.establish_connection(Calicli.config.active_record_config)
|
3
|
+
#ActiveRecord::Base.logger = Logger.new(STDOUT)
|
4
|
+
|
5
|
+
class Block < ActiveRecord::Base
|
6
|
+
self.table_name = "t_bloque"
|
7
|
+
self.primary_key = "iID_BLOQUE"
|
8
|
+
|
9
|
+
has_many :areas, foreign_key: "iID_BLOQUE"
|
10
|
+
end
|
11
|
+
|
12
|
+
class Area < ActiveRecord::Base
|
13
|
+
self.table_name = "t_area"
|
14
|
+
self.primary_key = "iID_AREA"
|
15
|
+
|
16
|
+
belongs_to :block
|
17
|
+
end
|
18
|
+
|
19
|
+
class Ribbon < ActiveRecord::Base
|
20
|
+
self.table_name = "t_cintas"
|
21
|
+
self.primary_key = "iID_CINTA"
|
22
|
+
end
|
23
|
+
|
24
|
+
class User < ActiveRecord::Base
|
25
|
+
self.table_name = "t_usuarios"
|
26
|
+
self.primary_key = "iID_USUARIO"
|
27
|
+
end
|
28
|
+
|
29
|
+
class Harvest < ActiveRecord::Base
|
30
|
+
self.table_name = "t_cosecha"
|
31
|
+
self.primary_key = "iID_ENTREGA"
|
32
|
+
|
33
|
+
belongs_to :user, foreign_key: "iID_USUARIO"
|
34
|
+
belongs_to :boss, class_name: "User", foreign_key: "iID_PADRE"
|
35
|
+
belongs_to :area, foreign_key: "iID_AREA"
|
36
|
+
belongs_to :ribbon, foreign_key: "iID_CINTA"
|
37
|
+
|
38
|
+
has_many :evaluations, foreign_key: "iID_ENTREGA"
|
39
|
+
end
|
40
|
+
|
41
|
+
class Property < ActiveRecord::Base
|
42
|
+
self.table_name = "t_propiedaevalua"
|
43
|
+
self.primary_key = "iID_DATO"
|
44
|
+
|
45
|
+
has_many :evaluations, foreign_key: "iID_DATO"
|
46
|
+
end
|
47
|
+
|
48
|
+
class Evaluation < ActiveRecord::Base
|
49
|
+
self.table_name = "t_evaluacion"
|
50
|
+
self.primary_key = "iID_EVALUACION"
|
51
|
+
|
52
|
+
belongs_to :harvest, foreign_key: "iID_ENTREGA"
|
53
|
+
belongs_to :property, foreign_key: "iID_DATO"
|
54
|
+
belongs_to :user, foreign_key: "iID_USUARIO"
|
55
|
+
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: calicli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josef Sauter
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-02-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.20'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.20'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: awesome_print
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activerecord
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 5.0.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 5.0.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rest-client
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: nokogiri
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: aws-sdk-s3
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: aws-sdk-sqs
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: jwt
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: mysql2
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: quick_store
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Calinda Sync Ops
|
168
|
+
email:
|
169
|
+
- Josef.Sauter@gmail.com
|
170
|
+
executables:
|
171
|
+
- calicli
|
172
|
+
extensions: []
|
173
|
+
extra_rdoc_files: []
|
174
|
+
files:
|
175
|
+
- CHANGELOG.md
|
176
|
+
- Gemfile
|
177
|
+
- Gemfile.lock
|
178
|
+
- README.md
|
179
|
+
- Rakefile
|
180
|
+
- bin/console
|
181
|
+
- bin/setup
|
182
|
+
- calicli.gemspec
|
183
|
+
- exe/calicli
|
184
|
+
- lib/calicli.rb
|
185
|
+
- lib/calicli/cli.rb
|
186
|
+
- lib/calicli/cli/base.rb
|
187
|
+
- lib/calicli/configuration.rb
|
188
|
+
- lib/calicli/version.rb
|
189
|
+
- lib/romana.rb
|
190
|
+
homepage: https://www.agilesd.com
|
191
|
+
licenses: []
|
192
|
+
metadata:
|
193
|
+
homepage_uri: https://www.agilesd.com
|
194
|
+
source_code_uri: https://www.agilesd.com
|
195
|
+
changelog_uri: https://www.agilesd.com
|
196
|
+
post_install_message:
|
197
|
+
rdoc_options: []
|
198
|
+
require_paths:
|
199
|
+
- lib
|
200
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: 2.6.0
|
205
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ">="
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
210
|
+
requirements: []
|
211
|
+
rubygems_version: 3.2.3
|
212
|
+
signing_key:
|
213
|
+
specification_version: 4
|
214
|
+
summary: Calinda Sync Ops
|
215
|
+
test_files: []
|