# Generated from noty-0.1.1.gem by gem2rpm -*- rpm-spec -*-
%global gem_name noty

Name: rubygem-%{gem_name}
Version: 0.1.1
Release: 1%{?dist}
Summary: Terminal storage for bookmarks or snippets
License: MIT
URL: https://www.github.com/blazeeboy/noty
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
# BuildRequires: rubygem(minitest) >= 5.0
# BuildRequires: rubygem(minitest) < 6
BuildArch: noarch

%description
# Noty
A bookmarks and snippets manager, stores bookmarks as YAML files and nippets
as plain text, utilizes "Ag silver searcher" fast search to search your files
when you need to open or copy a snippet, that makes its searching capabilities
so enourmouse as it's inherited from AG.
Noty is smart, so it react depending on your input, so provide URL and it'll
create a bookmark, provide some text and it will search for it in all
bookmarks and snippets, if it didn't find any files it will prompt you to
create a snippet.
Some common usages could be, bookmarking URL, save snippet of text you liked,
save some canned responses and quickly copy it when needed.
## Installation
```bash
$ gem install noty
```
## Requirements
1. ag : silver searcher https://github.com/ggreer/the_silver_searcher
### For Linux:
1. xsel : could be found on most distros official repositories
2. xdg-open : should be installed with most opendesktop compatible desktop
environments
## Environment
by default Noty saves your files in `~/.notes` if you want to change that
path, define an Environment variable in your shell init file `.bashrc` or
`.zshrc`
```bash
export NOTES_PATH=/path/to/your/notes/dir
```
## Usage
Snippets and bookmarks manager.
**Usage:**
```bash
noty inputs
```
**Input types:**
1. **url:** e.g "http://www.example.com", add URL as a bookmark file
2. **keyword:** search bookmarks and perform action on it, a single word of
multiple words or regex, it is passed to "ag silver searcher"
3. **snippet text:** any multiword text, it will search first if no files
contain this text you'll be asked if you want to create a snippet for it
## Examples
Add a bookmark
```bash
noty https://www.youtube.com
```
Search for bookmark
```bash
noty youtube
```
Add a snippet text
```bash
noty this is a long text that I need to save in my stash
```
Search for a snippet (same as searching for bookmarks)
```bash
noty need
```
## Contributing
Bug reports and pull requests are welcome on GitHub at
https://github.com/blazeeboy/noty.
## License
The gem is available as open source under the terms of the [MIT
License](http://opensource.org/licenses/MIT).


%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
%setup -q -n %{gem_name}-%{version}

%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/


mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x

%check
pushd .%{gem_instdir}
# ruby -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd

%files
%dir %{gem_instdir}
%{_bindir}/noty
%exclude %{gem_instdir}/.gitignore
%exclude %{gem_instdir}/.travis.yml
%license %{gem_instdir}/LICENSE.txt
%{gem_instdir}/bin
%{gem_instdir}/exe
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/noty.gemspec

%changelog
* Tue Sep 14 2021 mockbuilder - 0.1.1-1
- Initial package