Skip to content

Commit

Permalink
serup 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tashirosota committed Jan 24, 2022
1 parent 5fd99b6 commit 39b17cb
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# Changelog

## v0.5.0 (2022-1-xx)

### Features

- RList.ActiveSupport

## v0.4.0 (2022-1-24)

### Features
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ See **[hexdocs](https://hexdocs.pm/r_enum)**.
- REnum.ActiveSupport
- [x] 0.4.0
- RList.Ruby
- [ ] 0.5.0
- [x] 0.5.0
- RList.ActiveSupport
- [ ] 0.6.0
- RMap.Ruby
Expand All @@ -122,7 +122,7 @@ See **[hexdocs](https://hexdocs.pm/r_enum)**.
| REnum | Elixir Module | Ruby Class | Elixir | Ruby | ActiveSupport |
| ------- | ------------- | ---------------- | :----: | :--: | :-----------: |
| REnum | Enum | Enumerable ||||
| RList | List | Array ||| TODO |
| RList | List | Array ||| |
| RMap | Map | Hash || TODO | TODO |
| RRange | Range | Range || TODO | TODO |
| RStream | Stream | Enumerator::Lazy || TODO | TODO |
1 change: 1 addition & 0 deletions lib/r_enum.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule REnum do
See also
- [REnum.Native](https://hexdocs.pm/r_enum/REnum.Native.html#content)
- [REnum.Ruby](https://hexdocs.pm/r_enum/REnum.Ruby.html#content)
- [REnum.ActiveSupport](https://hexdocs.pm/r_enum/REnum.ActiveSupport.html#content)
- [REnum.Support](https://hexdocs.pm/r_enum/REnum.Support.html#content)
"""
defmacro __using__(opts) do
Expand Down
2 changes: 1 addition & 1 deletion lib/r_enum/active_support.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule REnum.ActiveSupport do
@moduledoc """
Summarized all of Enumerable functions in Rails.ActiveSupport.
If a function with the same name already exists in Elixir, that is not implemented.
Defines all of here functions when `use RUtils`.
Defines all of here functions when `use ActiveSupport`.
"""
@spec __using__(any) :: list
defmacro __using__(_opts) do
Expand Down
1 change: 1 addition & 0 deletions lib/r_list.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule RList do
See also.
- [RList.Native](https://hexdocs.pm/r_enum/RList.Native.html#content)
- [RList.Ruby](https://hexdocs.pm/r_enum/RList.Ruby.html#content)
- [RList.ActiveSupport](https://hexdocs.pm/r_enum/RList.ActiveSupport.html#content)
- [REnum](https://hexdocs.pm/r_enum/REnum.html#content)
"""
use RList.Native
Expand Down
32 changes: 31 additions & 1 deletion lib/r_list/active_support.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
defmodule RList.ActiveSupport do
@moduledoc """
Unimplemented.
Summarized all of List functions in Rails.ActiveSupport.
If a function with the same name already exists in Elixir, that is not implemented.
Defines all of here functions when `use ActiveSupport`.
"""
@spec __using__(any) :: list
defmacro __using__(_opts) do
RUtils.define_all_functions!(__MODULE__)
end

@type type_enumerable :: Enumerable.t()
@type type_pattern :: number() | String.t() | Range.t() | Regex.t()

# https://www.rubydoc.info/gems/activesupport/Array
# [:as_json, :compact_blank!, :deep_dup, :excluding, :extract!, :extract_options!, :fifth, :forty_two, :fourth, :from, :in_groups, :in_groups_of, :including, :inquiry, :second, :second_to_last, :split, :sum, :third, :third_to_last, :to, :to_default_s, :to_formatted_s, :to_param, :to_query, :to_s, :to_sentence, :to_xml]
# |> RUtils.required_functions([List, REnum])
# as_json
# deep_dup
# fifth
# forty_two
# fourth
# from
# in_groups
# in_groups_of
# inquiry
# second
# second_to_last
# third
# third_to_last
# to
# to_default_s
# to_formatted_s
# to_param
# to_query
# to_s
# to_sentence
# to_xml
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule REnum.MixProject do
use Mix.Project
@versoin "0.4.0"
@versoin "0.5.0"
@source_url "https://github.com/tashirosota/ex-r_enum"
@description "REnum is Enum extended with convenient functions inspired by Ruby and Rails ActiveSupport."
def project do
Expand Down

0 comments on commit 39b17cb

Please sign in to comment.