Skip to content

Commit

Permalink
Remove jeweler, bump to ruby 3 (#29)
Browse files Browse the repository at this point in the history
* Removed jeweler

* Simplify

* 31.6.2017 gets parsed as 1.7.2017, but 32.6.2017 actually throws an error, what? is 31st in June such a common mistake the software takes it into account? but it's not correct, it's weird

* Update test suite, default timezone is set to Amsterdam, if you need something else, use .devlog.yml

* Fix info string

* Move code

* Utils

* Utils

* Utils

* Changelog, gemspec, readme updates

* Set timezone first

* Set timezone first
  • Loading branch information
mihael authored Oct 17, 2024
1 parent a65fbe8 commit 2dc3cbc
Show file tree
Hide file tree
Showing 20 changed files with 350 additions and 220 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## [Unreleased]

## [0.4.0] - 2024-10-17

- Bump to ruby 3, which is now a dependency
- Timezone support with the .devlog.yml setting
- Remove Jeweler in favor of Bundler
15 changes: 9 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# frozen_string_literal: true

source "https://rubygems.org"

# gemspec # jeweler 2.0.1 adds 'devlog' it self as a dependency for some reason, which results in Travis failing
gem "activesupport", "> 4.1"
# Specify your gem's dependencies in devlog.gemspec
gemspec

gem "rake", "~> 13.0"
gem "activesupport"

group :development, :test do
gem "test-unit", "~> 3.1"
gem "jeweler", "~> 2.0"
gem "nokogiri", "~> 1.8" # jeweler 2.0.1 depends on 1.5.10, but that has sec issue
end
gem "test-unit"
end
3 changes: 0 additions & 3 deletions LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 mihael

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,19 @@ devlog_file: ../info/devlog.markdown
weekly_timesheet_template: ../info/weekly_timesheet.erb.html
convert_to_pdf_command: wkhtmltopdf --dpi 400 --viewport-size 600x800 --orientation Landscape
```

development
===========

Run test suite:

```
rake test
```

Build and install gem locally:

```
rake build
rake install
```
62 changes: 8 additions & 54 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,58 +1,12 @@
require 'rubygems'
require 'rake'
# frozen_string_literal: true

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "devlog"
gem.summary = %Q{takes devlog.markdown and gives info}
gem.description = %Q{devlog.markdown time&space extractor}
gem.email = "[email protected]"
gem.homepage = "http://github.com/mihael/devlog"
gem.authors = ["mihael"]
gem.executables = ["devlog"]
gem.license = 'MIT'
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
require "bundler/gem_tasks"
require "rake/testtask"

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end

task :test #=> :check_dependencies

task :default => :test

require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION')
version = File.read('VERSION')
else
version = ""
end

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "devlog #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task default: :test
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

11 changes: 11 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "devlog"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
92 changes: 49 additions & 43 deletions devlog.gemspec
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: devlog 0.3.5 ruby lib
# frozen_string_literal: true

Gem::Specification.new do |s|
s.name = "devlog".freeze
s.version = "0.3.5"
require_relative "lib/devlog/version"

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["mihael".freeze]
s.date = "2023-09-25"
s.description = "devlog.markdown time&space extractor".freeze
s.email = "[email protected]".freeze
s.executables = ["devlog".freeze]
s.extra_rdoc_files = [
"LICENSE",
"README.md"
]
s.files = [
Gem::Specification.new do |spec|
spec.name = "devlog"
spec.version = Devlog::VERSION
spec.authors = ["mihael"]
spec.email = ["[email protected]"]

spec.summary = "Write a development log while also easily track time spent in coding sessions using just a markdown text file and a few CLI commands."
spec.description = "devlog.markdown time&space extractor ~ Track the time spent in coding sessions and money payed to you, while also writing a development log. Export a timesheet for your bills."
spec.homepage = "https://manitu.si/devlog"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0.0"

spec.metadata["allowed_push_host"] = "https://rubygems.org"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/mihael/devlog"
spec.metadata["changelog_uri"] = "https://github.com/mihael/devlog/blob/main/CHANGELOG.md"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# gemspec = File.basename(__FILE__)
# spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
# ls.readlines("\x0", chomp: true).reject do |f|
# (f == gemspec) ||
# f.start_with?(*%w[bin/ lib/ sublime_text/ templates/ test/ .git .github .gitignore .ruby-gemset .ruby-version devlog.gemspec devlog.markdown Gemfile LICENSE.txt CHANGELOG.md README.md Rakefile tmp/.gitignore])
# end
# end
spec.files = [
".github/workflows/devlog_test.yml",
".ruby-gemset",
".ruby-version",
"Gemfile",
"LICENSE",
"LICENSE.txt",
"README.md",
"CHANGELOG.md",
"Rakefile",
"VERSION",
"bin/devlog",
"bin/console",
"bin/setup",
"exe/devlog",
"devlog.gemspec",
"devlog.markdown",
"lib/devlog.rb",
"lib/devlog_settings.rb",
"lib/devlog/utils.rb",
"lib/devlog/date_time_ago_in_words.rb",
"lib/devlog/settings.rb",
"lib/devlog/version.rb",
"sublime_text/devlog.tmbundle/Snippets/begin.tmSnippet",
"sublime_text/devlog.tmbundle/Snippets/combegin.tmSnippet",
"sublime_text/devlog.tmbundle/Snippets/comend.tmSnippet",
Expand Down Expand Up @@ -62,25 +77,16 @@ Gem::Specification.new do |s|
"test/test_helper.rb",
"tmp/.gitignore"
]
s.homepage = "http://github.com/mihael/devlog".freeze
s.licenses = ["MIT".freeze]
s.rubygems_version = "3.2.15".freeze
s.summary = "takes devlog.markdown and gives info".freeze

if s.respond_to? :specification_version then
s.specification_version = 4
end
spec.bindir = "exe"
spec.executables = ["devlog"]
spec.require_paths = ["lib"]

if s.respond_to? :add_runtime_dependency then
s.add_runtime_dependency(%q<activesupport>.freeze, ["> 4.1"])
s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.1"])
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.0"])
s.add_development_dependency(%q<nokogiri>.freeze, ["~> 1.8"])
else
s.add_dependency(%q<activesupport>.freeze, ["> 4.1"])
s.add_dependency(%q<test-unit>.freeze, ["~> 3.1"])
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
s.add_dependency(%q<nokogiri>.freeze, ["~> 1.8"])
end
end
# Dependencies
spec.add_dependency "activesupport"
spec.add_development_dependency "test-unit"
spec.add_development_dependency "nokogiri"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
end
17 changes: 16 additions & 1 deletion devlog.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#17.10.2024 09:10:08 CodingSession::END

Fixing up for ruby 3 and doing some minor cleanup.

Ditching jeweler for bundler to package and release gem.

The tasks to work with the gem are now:

rake build
rake install
rake release

More here: https://bundler.io/guides/creating_gem.html

#17.10.2024 05:20:32 CodingSession::BEGIN

#23.09.2019 23:08:08 CodingSession::END

some quick adjustments...
Expand Down Expand Up @@ -130,7 +146,6 @@ aha... no comment haha...

#09.02.2015 15:41:09 CodingSession::BEGIN


#02.02.2015 17:53:20 CodingSession::END

cleaning up a little... enhancing the devlog executable features...
Expand Down
5 changes: 4 additions & 1 deletion bin/devlog → exe/devlog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
require 'benchmark'
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib devlog.rb]))
require "active_support/configurable"

USAGE = <<-EOF
#{Devlog.display_version}
This software is intended to parse and present information within devlog.markdown development logs. It also helps You to write the devlog.
Expand Down Expand Up @@ -68,7 +70,8 @@ include Devlog

def dodo
load_settings('.devlog.yml')
ENV['TZ'] = devlog_timezone_setting
tz = devlog_timezone_setting
puts "Timezone: {tz}"
default_devlog_file = devlog_file_setting
time = Benchmark.realtime do
if @in_file_or_cmd =~ /.(markdown|md)$/ # devlog_file is passed directly via CLI
Expand Down
Loading

0 comments on commit 2dc3cbc

Please sign in to comment.