qismo 0.17.9 → 0.17.10

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: c8260840932bcba50d8c29097ecdb86182d53d34337fdddb624a9f60708fb0a6
4
- data.tar.gz: a474e1ce7cad0d6c9529f32a9a58abb01ad76798227f9b43c8825a561038e18f
3
+ metadata.gz: 438e37ba8805d97e8cc2265c11929b274b8fa5387293b2e2f20fe5add2b54c9f
4
+ data.tar.gz: acb21b8465d43cbadb921578df6f6332ef660d55fd907e03508491074c36cbce
5
5
  SHA512:
6
- metadata.gz: 7bfcfcd390b1cea3ee31fc67ac5649f518327bea9c7c09471f1b3f36b2cab36ca9e4a19798f07d512fdb2b58960ceaf5e2c7b070849a737dc0e395362064f97b
7
- data.tar.gz: a3f990481404e878c7504e3e71e5ecb9191ba7cb753643f4d7cd225b1f501e42f068ac2d0aeba4acedb0a66ef302a4615d9fde535bcb2724c2256e52be185150
6
+ metadata.gz: b7ed4f10abe1da26a27ebe6994075e0346abcbbe56175f5d81a465e4514a98095775d21bb508ee46e67f027040b6276104eb3500f6011764507a4905d0122653
7
+ data.tar.gz: 29e8e66f501de53c1f9264827dd0105b18594c9d183e97476f040666c456ce66347f513150e7db1e46459b312af3da4e79ee2a2d95bd14994dee2702ccf4d4db
data/Rakefile CHANGED
@@ -10,5 +10,3 @@ 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.9"
5
+ VERSION = "0.17.10"
6
6
  end
data/lib/qismo.rb CHANGED
@@ -45,19 +45,9 @@ require "qismo/webhook_requests/on_room_resolved"
45
45
  require "qismo/api"
46
46
  require "qismo/client"
47
47
 
48
+ require "railtie" if defined?(Rails)
49
+
48
50
  # Qismo ruby root module
49
51
  #
50
52
  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
63
53
  end
data/lib/railtie.rb ADDED
@@ -0,0 +1,13 @@
1
+ require "qismo"
2
+ require "rails"
3
+
4
+ module Qismo
5
+ class Railtie < Rails::Railtie
6
+ railtie_name :qismo
7
+
8
+ rake_tasks do
9
+ path = File.expand_path(__dir__)
10
+ Dir.glob("#{path}/tasks/*.rake").each { |f| load f }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ namespace :qismo do
2
+ namespace :vscode_snippet do
3
+ desc "Generate Qismo VSCode snippet"
4
+ task :create do
5
+ source_file = Pathname.new(Gem.loaded_specs["qismo"]&.full_gem_path).join("vscode-snippet", "qismo.code-snippets")
6
+ destination_folder = Rails.root.join(".vscode")
7
+
8
+ FileUtils.mkdir(destination_folder.to_s) unless Dir.exist?(destination_folder.to_s)
9
+ FileUtils.cp(source_file.to_s, destination_folder.to_s)
10
+
11
+ puts "Successfully created Qismo vscode snippet"
12
+ end
13
+
14
+ desc "Delete Qismo VSCode snippet"
15
+ task :delete do
16
+ destination_file = Rails.root.join(".vscode", "qismo.code-snippets")
17
+ FileUtils.rm_f(destination_file)
18
+
19
+ puts "Successfully deleted Qismo vscode snippet"
20
+ end
21
+ end
22
+ end
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.9
4
+ version: 0.17.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Qiscus Integration
@@ -112,15 +112,16 @@ 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
+ - lib/railtie.rb
116
+ - lib/tasks/vscode_snippet.rake
116
117
  - qismo.gemspec
117
118
  - vscode-snippet/qismo.code-snippets
118
119
  homepage: https://bitbucket.org/qiscus/qismo-rb
119
120
  licenses:
120
121
  - MIT
121
122
  metadata:
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
123
+ source_code_uri: https://bitbucket.org/qiscus/qismo-rb/src/v0.17.10
124
+ documentation_uri: https://www.rubydoc.info/gems/qismo/0.17.10
124
125
  homepage_uri: https://bitbucket.org/qiscus/qismo-rb
125
126
  rubygems_mfa_required: 'true'
126
127
  post_install_message:
@@ -1,17 +0,0 @@
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