qismo 0.17.6 → 0.17.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a44082e18e6a2a83f52495239286434f94929f70ed04169719d54b31e3d222f
4
- data.tar.gz: b4539c710a2172b0bdb7049d140d3cf197aa7e081507d6c1c12422e38eb7c8db
3
+ metadata.gz: c8260840932bcba50d8c29097ecdb86182d53d34337fdddb624a9f60708fb0a6
4
+ data.tar.gz: a474e1ce7cad0d6c9529f32a9a58abb01ad76798227f9b43c8825a561038e18f
5
5
  SHA512:
6
- metadata.gz: d53cfb2641b87854f7dd6dc5c96b228679e8c5fa96266b90085fb97e1bbe4a794cd12452d9f37123888c3cac07e30fc7915059eb362c269d46ec16468bb5b22f
7
- data.tar.gz: 0a4550b86a6dd7e520bae304b3f59042fe3c4dee1b4ce315a25223f3d5f5635c3e55ed06a40ca94ca6f96ec698363611c57c696c11b80315b1c4540c06541f71
6
+ metadata.gz: 7bfcfcd390b1cea3ee31fc67ac5649f518327bea9c7c09471f1b3f36b2cab36ca9e4a19798f07d512fdb2b58960ceaf5e2c7b070849a737dc0e395362064f97b
7
+ data.tar.gz: a3f990481404e878c7504e3e71e5ecb9191ba7cb753643f4d7cd225b1f501e42f068ac2d0aeba4acedb0a66ef302a4615d9fde535bcb2724c2256e52be185150
data/Rakefile CHANGED
@@ -10,3 +10,5 @@ require "rubocop/rake_task"
10
10
  RuboCop::RakeTask.new
11
11
 
12
12
  task default: %i[spec rubocop]
13
+
14
+ import "./lib/tasks/vscode-snippet.rake"
data/lib/qismo/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Qismo
4
4
  # @return [String]
5
- VERSION = "0.17.6"
5
+ VERSION = "0.17.9"
6
6
  end
data/lib/qismo.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
3
4
  require "active_support/all"
4
5
  require "dry-struct"
5
6
  require "http"
@@ -47,4 +48,16 @@ require "qismo/client"
47
48
  # Qismo ruby root module
48
49
  #
49
50
  module Qismo
51
+ # @return [Pathname]
52
+ def self.root_path
53
+ Pathname.new(File.expand_path(__dir__))
54
+ end
55
+
56
+ # @return [Pathname]
57
+ def self.gem_path
58
+ loaded_specs = Gem.loaded_specs["qismo"]
59
+ raise ArgumentError.new("qismo not loaded yet") if loaded_specs.nil?
60
+
61
+ Pathname.new(loaded_specs.full_gem_path)
62
+ end
50
63
  end
@@ -0,0 +1,17 @@
1
+ require "fileutils"
2
+ require "qismo"
3
+
4
+ desc "Generate Vscode snippets of this gem"
5
+ namespace :qismo do
6
+ task :generate_vscode_snippets do
7
+ code_snippet_file = Qismo.gem_path.join("..", "..", "vscode-snippet", "qismo.code-snippets")
8
+
9
+ destination_folder = Qismo.root_path.join(".vscode")
10
+ if defined?(Rails)
11
+ destination_folder = Rails.root.join(".vscode")
12
+ end
13
+
14
+ FileUtils.mkdir(destination_folder.to_s) unless Dir.exist?(destination_folder.to_s)
15
+ FileUtils.cp(code_snippet_file.to_s, destination_folder.to_s)
16
+ end
17
+ end
data/qismo.gemspec CHANGED
@@ -16,9 +16,10 @@ Gem::Specification.new do |spec|
16
16
  spec.license = "MIT"
17
17
 
18
18
  spec.metadata = {
19
- "source_code_uri" => "https://bitbucket.org/qiscus/qismo-rb",
20
- "documentation_uri" => "https://www.rubydoc.info/gems/qismo",
21
- "homepage_uri" => spec.homepage
19
+ "source_code_uri" => "https://bitbucket.org/qiscus/qismo-rb/src/v#{spec.version}",
20
+ "documentation_uri" => "https://www.rubydoc.info/gems/qismo/#{spec.version}",
21
+ "homepage_uri" => spec.homepage,
22
+ "rubygems_mfa_required" => "true"
22
23
  }
23
24
 
24
25
  ignored = Regexp.union(
@@ -0,0 +1,35 @@
1
+ {
2
+ "Initiate Qismo client": {
3
+ "prefix": "Qismo",
4
+ "body": [
5
+ "client = Qismo::Client.new(",
6
+ " app_id: \"${1:app_id}\",",
7
+ " secret_key: \"${2:secret_key}\",",
8
+ " url: \"https://qismo.qiscus.com\",",
9
+ " logger: Logger.new($stdout),",
10
+ " timeout: {connect: 5, write: 2, read: 10},",
11
+ " proxy: [\"proxy-hostname.local\", 8080, \"username\", \"password\"]",
12
+ ")"
13
+ ],
14
+ "description": "Initiate Qismo client"
15
+ },
16
+ "List rooms": {
17
+ "prefix": "client.rooms",
18
+ "body": [
19
+ "rooms = client.rooms(",
20
+ " channels: [{ source: \"wa\", channel_id: 716171 }],",
21
+ " status: \"unresolved\",",
22
+ " serve_status: \"served\",",
23
+ " is_handled_by_bot: false,",
24
+ " name: \"Qiscus\",",
25
+ " limit: 50,",
26
+ " tag_ids: [1,2,3],",
27
+ " user_ids: [5,6,7],",
28
+ " order: \"desc\",",
29
+ " cursor_before: \"\",",
30
+ " cursor_after: \"\"",
31
+ ")"
32
+ ],
33
+ "description": "List rooms"
34
+ }
35
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qismo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.6
4
+ version: 0.17.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Qiscus Integration
@@ -112,14 +112,17 @@ files:
112
112
  - lib/qismo/webhook_requests/on_message_for_bot_sent.rb
113
113
  - lib/qismo/webhook_requests/on_new_session_initiated.rb
114
114
  - lib/qismo/webhook_requests/on_room_resolved.rb
115
+ - lib/tasks/vscode-snippet.rake
115
116
  - qismo.gemspec
117
+ - vscode-snippet/qismo.code-snippets
116
118
  homepage: https://bitbucket.org/qiscus/qismo-rb
117
119
  licenses:
118
120
  - MIT
119
121
  metadata:
120
- source_code_uri: https://bitbucket.org/qiscus/qismo-rb
121
- documentation_uri: https://www.rubydoc.info/gems/qismo
122
+ source_code_uri: https://bitbucket.org/qiscus/qismo-rb/src/v0.17.9
123
+ documentation_uri: https://www.rubydoc.info/gems/qismo/0.17.9
122
124
  homepage_uri: https://bitbucket.org/qiscus/qismo-rb
125
+ rubygems_mfa_required: 'true'
123
126
  post_install_message:
124
127
  rdoc_options: []
125
128
  require_paths: