I learned about the existence of a gemspec file

[Caution] I didn't take the time to investigate, scrutinize, and confirm this article, so please read it in half.

Difference between Gemfile and xxx.gemspec

--Files used to manage the library

――The difference between these is --Rewrite Gemfile and my_rubygem.gemspec by yourself --Rails dependency library management edits Gemfile -** Edit my_rubygem.gemspec for gem dependency library management ** --Gemfile.lock can be rewritten by $ bundle install

gemspec file example

These are included in the files created by bundle gem my_ruby gem.

my_rubygem/lib/my_rubygem.rb
my_rubygem/lib/my_rubygem/version.rb
my_rubygem/my_rubygem.gemspec

Of these, rewrite as follows

my_rubygem/lib/my_rubygem/version.rb


module MyRubygem
  VERSION = "0.20.0"
end

my_rubygem/gemfile.gemspec


require "my_rubygem/version"

Gem::Specification.new do |spec|
  spec.name          = "MyRubygem"
  spec.version       = MyRubygem::VERSION
  spec.authors       = ["John Lennon"]
  spec.email         = ["[email protected]"]

  .....

end

reference

Recommended Posts

I learned about the existence of a gemspec file
I made a tool to output the difference of CSV file
[Personal memo] I learned a little about modifiers
Summary of what I learned about Spring Boot
I wrote a sequence diagram of the j.u.c.Flow sample
I have a question about keyboard input of numbers
About the handling of Null
A note about the scope
About the File :: Stat class
I learned a lot about "principles of system design that are useful in the field", so I summarized them ~ Chapter 1 ~
What I learned about Kotlin
I took a peek at the contents of Java's HashMap
A note about the seed function of Ruby on Rails
I tried JAX-RS and made a note of the procedure
About the behavior when doing a file map with java
Why put a line break at the end of the file
[Java] I thought about the merits and uses of "interface"
When I switched to IntelliJ, I got a lot of differences in the encoding of the properties file.
I want to get a list of the contents of a zip file and its uncompressed size
About the behavior of ruby Hash # ==
About the language to be learned
About the basics of Android development
Replace the contents of the Jar file
I read the source of ArrayList I read
I read the source of Integer
I made a gem to post the text of org-mode to qiita
A memorandum of the FizzBuzz problem
I read the source of Long
I took a look at the resources of Azure Container Instance
A story about hitting the League Of Legends API with JAVA
A murmur about the utility class
About the role of the initialize method
Get the public URL of a private Flickr file in Java
I thought about the strategy of introducing Combine in iOS development
Think about the 7 rules of Optional
I tried incorporating the principle of a single file component into a rails 6 app. I'm not sure.
I read the source of Byte
[chown] How to change the owner of a file or directory
I read the source of String
Summary about the introduction of Device
About the log level of java.util.logging.Logger
Create a Tokyo subway map from the CSV file of station data.jp
How to find out the Java version of a compiled class file
About the continuous division method learned in the 4th grade of elementary school
Sample program that returns the hash value of a file in Java
I thought about the best way to create a ValueObject in Ruby
About the version of Docker's Node.js image
Create a jar file with the command
What is testing? ・ About the importance of testing
About the operation of next () and nextLine ()
What I learned through the swift teacher
I investigated the internal processing of Retrofit
[day: 5] I summarized the basics of Java
About the error message Invalid redeclaration of'***'
About the treatment of BigDecimal (with reflection)
About the number of threads of Completable Future
About the mechanism of the Web and HTTP
Find the difference from a multiple of 10
I have a question about Android studio.
I want to get a list of only unique character strings by excluding fixed character strings from the file name
What I tried when I wanted to get all the fields of a bean