midjourney-ruby 0.1.1 → 0.1.21

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: 727ce777e01b7a609b901f0eeb3b27c2f0568eb9f27c126a5e31391202afd8c4
4
- data.tar.gz: dd12224e8cd69ceaf548221db086f3b009456aa594a30fe438786f111e0a0c42
3
+ metadata.gz: 5c143a32dfee3e9931bcc253a14c6bdc96c50d3fb771dc5ea6d47a874b9c2ec3
4
+ data.tar.gz: 30945aa298dd6535b0edc64c368936d994e5014ed017fc7d255e84a923d1c15a
5
5
  SHA512:
6
- metadata.gz: 93b06c02f6ece38ef9fa4847d89b540ea8a08c5e519867349be534028ec725442b39608a975b387d713d2a6d21dfc73e9ecd36139563f6b265e8189d7d12c5ae
7
- data.tar.gz: 9047f70dd745f3a996ff9d7b74a8f4b6e470f7da664e97c83ab53765042d014ca0fda4964360c56f667e0c34d005ba8bf68923ae08492822063c145cbc94be93
6
+ metadata.gz: ac86d34aa8426971743b930778b15d6d7ff00753edf987ae7ad63593d9c1cf0a3ec7dd22a174ac054a61fc8772e3438e63b66d07f2b7e1386544bf6df129ae9d
7
+ data.tar.gz: d7dbeecd569dcf14b7b578357eccaf0070b43bebd2db3c1feb780eb99c93372012a8d0b40df33a6224c84edc44c662c8eedb9d94fc9fcd853d31c7ae5547d821
@@ -0,0 +1,9 @@
1
+ module Midjourney
2
+ class Configuration
3
+ attr_accessor :api_key
4
+
5
+ def initialize
6
+ @api_key = nil
7
+ end
8
+ end
9
+ end
data/lib/midjourney.rb ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "midjourney/configuration"
4
+
5
+ module Midjourney
6
+ VERSION = "0.1.21"
7
+
8
+ class Error < StandardError; end
9
+
10
+ def self.configuration
11
+ @@configuration ||= Configuration.new
12
+ end
13
+
14
+ def self.config
15
+ yield(configuration)
16
+ end
17
+ end
@@ -0,0 +1,26 @@
1
+ namespace :midjourney do
2
+ desc "Install Midjourney Ruby Client"
3
+ task install: :environment do
4
+ return :ok unless defined?(Rails)
5
+
6
+ initializer_content = <<~RUBY
7
+ # frozen_string_literal: true
8
+
9
+ Midjourney.config do |config|
10
+ # Fetch from an environment variable
11
+ config.api_key = ENV["MIDJOURNEY_API_KEY"]
12
+ # Or fetch from Rails credentials if you're using Rails 5.2+ and have credentials set up
13
+ config.api_key = Rails.application.credentials.midjourney_api_key # or whatever you named your key
14
+ end
15
+ RUBY
16
+
17
+ initializer_path = Rails.root.join("config", "initializers", "midjourney.rb")
18
+
19
+ if File.exist?(initializer_path)
20
+ puts "\n " + Rainbow("Midjourney Ruby").purple + " is already installed! 🎉"
21
+ else
22
+ File.open(initializer_path, "w") { |f| f.write(initializer_content) }
23
+ puts "\n " + Rainbow("Midjourney Ruby").purple + " has been installed! 🎉"
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midjourney-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Momente
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-09-29 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rspec
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.2'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '3.2'
12
+ dependencies: []
27
13
  description: This is a Ruby client for Midjourney that allows you to use its main
28
14
  products via their Discord API.
29
15
  email:
@@ -32,18 +18,14 @@ executables: []
32
18
  extensions: []
33
19
  extra_rdoc_files: []
34
20
  files:
35
- - ".rspec"
36
- - Gemfile
37
- - LICENSE.txt
38
- - README.md
39
- - Rakefile
40
- - lib/midjourney/ruby.rb
41
- - lib/midjourney/ruby/version.rb
42
- - sig/midjourney/ruby.rbs
21
+ - lib/midjourney.rb
22
+ - lib/midjourney/configuration.rb
23
+ - lib/tasks/install.rb
43
24
  homepage: https://github.com/leom806/midjourney-ruby
44
25
  licenses:
45
26
  - MIT
46
27
  metadata:
28
+ allowed_push_host: https://rubygems.org
47
29
  homepage_uri: https://github.com/leom806/midjourney-ruby
48
30
  source_code_uri: https://github.com/leom806/midjourney-ruby
49
31
  changelog_uri: https://github.com/leom806/midjourney-ruby/blob/main/CHANGELOG.md
@@ -65,5 +47,5 @@ requirements: []
65
47
  rubygems_version: 3.4.10
66
48
  signing_key:
67
49
  specification_version: 4
68
- summary: Ruby client for Midjourney.
50
+ summary: Ruby client for Midjourney
69
51
  test_files: []
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in midjourney-ruby.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2023 Leonardo Momente
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,37 +0,0 @@
1
- # Midjourney Ruby
2
-
3
- Midjourney is an awesome tool that brings great value to products.
4
- This gem was created to facilitate Ruby and also Rails applications to use all services of Midjourney directly.
5
-
6
- Keep in mind that you need to have a Midjourney account to use this gem, checkout [Midjourney](https://midjourney.com) for more information.
7
-
8
- ## Installation
9
-
10
- Add the following to your Gemfile:
11
-
12
- ```shell
13
- gem "midjourney-ruby"
14
- ```
15
-
16
- Run `bundle install`.
17
-
18
- That's it. You are now ready to go!
19
-
20
- ## Usage
21
-
22
- ### Imagine
23
-
24
- ## Development
25
-
26
- 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.
27
-
28
- 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).
29
-
30
- ## Contributing
31
-
32
- Bug reports and pull requests are welcome on GitHub at [Open an Issue](https://github.com/leom806/midjourney-ruby).
33
-
34
- ## License
35
-
36
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
37
- Feel free to use it and contribute.
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Midjourney
4
- module Ruby
5
- VERSION = "0.1.1"
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "ruby/version"
4
-
5
- module Midjourney
6
- module Ruby
7
- class Error < StandardError; end
8
- # Your code goes here...
9
- end
10
- end
@@ -1,6 +0,0 @@
1
- module Midjourney
2
- module Ruby
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
- end
6
- end