cronit 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a7fc6d6664b87c469755e770124087f8eb1e504b9ac53bd34df5949a2da16de9
4
+ data.tar.gz: bc8376831c45faa4705668328e9a62f4b71480c81177a451cc3847223e00898a
5
+ SHA512:
6
+ metadata.gz: f7ecfb068b64f7ac8cc796cc0b1032c4fa673e153498d4c15b992406d58b976154a3b75cc26c9aee07abb36eb0b8c27ed47102f49e50bfde57d18d5d002afb88
7
+ data.tar.gz: 7a01d4b3cecd2fb59c470cb51c2851a1861157dfb778483505a9da47b4a8f12bc61657e8ca002b9dec1958abfe19ad5292ff2e276a6e6908a9b8d542d18e89d8
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Cronit
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/cronit`. 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 'cronit'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cronit
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. 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]/cronit.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
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 "cronit"
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cronit
4
+ VERSION = "1.0.0"
5
+ end
data/lib/cronit.rb ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "cronit/version"
4
+
5
+
6
+ module Cronit
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+
10
+ class Cronit
11
+ def initialize(api_key)
12
+ @api_key = api_key
13
+ end
14
+
15
+ def list_crons
16
+ HTTParty.get('https://api.cronit.app/v1/crons', {headers: {authorization: @api_key}})
17
+ end
18
+
19
+ def run_cron(cron_id)
20
+ HTTParty.post('https://api.cronit.app/v1/crons/' + cron_id + '/run', {headers: {authorization: @api_key}})
21
+ end
22
+
23
+ def toggle_cron(cron_id)
24
+ HTTParty.post('https://api.cronit.app/v1/crons/' + cron_id + '/toggle', {headers: {authorization: @api_key}})
25
+ end
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cronit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Cronit
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-09-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Ruby bindings for https://cronit.app cronjob scheduling app
28
+ email:
29
+ - alexis@cronit.app
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - Gemfile
35
+ - README.md
36
+ - Rakefile
37
+ - bin/console
38
+ - bin/setup
39
+ - lib/cronit.rb
40
+ - lib/cronit/version.rb
41
+ homepage: https://cronit.app
42
+ licenses: []
43
+ metadata:
44
+ homepage_uri: https://cronit.app
45
+ source_code_uri: https://github.com/Cronit-app/binding-ruby
46
+ changelog_uri: https://github.com/Cronit-app/binding-ruby
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 2.6.0
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.2.32
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Ruby bindings for https://cronit.app cronjob scheduling app
66
+ test_files: []