study_line 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/.rspec +3 -0
- data/.rubocop.yml +13 -0
- data/CHANGELOG.md +5 -0
- data/README.md +32 -0
- data/Rakefile +12 -0
- data/lib/study_line/version.rb +5 -0
- data/lib/study_line.rb +48 -0
- data/sig/study_line.rbs +4 -0
- data/study_line.gemspec +39 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 97a64cb9ebb2af56bc9197619f0076c5cca61ec4f7c358a868d928c1875016c7
|
4
|
+
data.tar.gz: bc1ff4d7b835e53b36d0e5dfa532654c510547c7197cdeee96495fd69d9f42c0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b5a6a3e2b43b2640b9e3f4bc7cb68f4c98e6bd8ae26b0757ebc1c9f05ad4d820631655055a995d7d5de31938e7a5570b81ac30721894c53a7052540ece62879
|
7
|
+
data.tar.gz: 1a5b39f79fa173cb441c5027fdbe3b39028203b9f1b34dd41ea3175658b107433a686e50db682606f6936ae417131422277fc2b11cd4687ef897c0b752339fd6
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# StudyLine
|
2
|
+
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
|
+
|
5
|
+
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/study_line`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
14
|
+
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
+
|
17
|
+
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
26
|
+
|
27
|
+
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).
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/study_line.
|
32
|
+
# study_line
|
data/Rakefile
ADDED
data/lib/study_line.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
module StudyLine
|
7
|
+
class CLI < Thor
|
8
|
+
class Sender
|
9
|
+
include HTTParty
|
10
|
+
BASE_URI = 'http://localhost:3000/dashboards'
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "start", "Record the start time of study"
|
14
|
+
def start
|
15
|
+
start_time = Time.now
|
16
|
+
response = Sender.post(
|
17
|
+
"#{Sender::BASE_URI}/start",
|
18
|
+
body: { start_time: start_time }.to_json,
|
19
|
+
headers: headers
|
20
|
+
)
|
21
|
+
# Handle the response...
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "finish", "Record the finish time of study"
|
25
|
+
def finish
|
26
|
+
end_time = Time.now
|
27
|
+
response = Sender.post(
|
28
|
+
"#{Sender::BASE_URI}/finish",
|
29
|
+
body: { end_time: end_time }.to_json,
|
30
|
+
headers: headers
|
31
|
+
)
|
32
|
+
# Handle the response...
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def user_token
|
38
|
+
ENV['CUSTOM_TOKEN'] || (raise "Error: Token not found.")
|
39
|
+
end
|
40
|
+
|
41
|
+
def headers
|
42
|
+
{
|
43
|
+
'Content-Type' => 'application/json',
|
44
|
+
'Authorization' => "Bearer #{user_token}"
|
45
|
+
}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/sig/study_line.rbs
ADDED
data/study_line.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/study_line/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "study_line"
|
7
|
+
spec.version = StudyLine::VERSION
|
8
|
+
spec.authors = ["kentaro0215"]
|
9
|
+
spec.email = ["ken.runteq0215@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "A CLI tool to track and manage study time."
|
12
|
+
spec.description = "StudyLine is a CLI tool designed to help users track and manage their study time effectively."
|
13
|
+
spec.homepage = "https://github.com/kentaro0215/study_line"
|
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"] = "TODO: Put your gem's public repo URL here."
|
20
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
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(__dir__) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(File.expand_path(f) == __FILE__) ||
|
27
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
# Uncomment to register a new dependency of your gem
|
35
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
36
|
+
|
37
|
+
# For more information and examples about making a new gem, check out our
|
38
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: study_line
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- kentaro0215
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-10-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: StudyLine is a CLI tool designed to help users track and manage their
|
14
|
+
study time effectively.
|
15
|
+
email:
|
16
|
+
- ken.runteq0215@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".rspec"
|
22
|
+
- ".rubocop.yml"
|
23
|
+
- CHANGELOG.md
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- lib/study_line.rb
|
27
|
+
- lib/study_line/version.rb
|
28
|
+
- sig/study_line.rbs
|
29
|
+
- study_line.gemspec
|
30
|
+
homepage: https://github.com/kentaro0215/study_line
|
31
|
+
licenses: []
|
32
|
+
metadata:
|
33
|
+
homepage_uri: https://github.com/kentaro0215/study_line
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.6.0
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubygems_version: 3.4.21
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: A CLI tool to track and manage study time.
|
53
|
+
test_files: []
|